Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is there an equivalent for threadDelayForum ↗

Is there an equivalent for threadDelay

App Development4 posts239 views1 likesLast activity Sep 2023
CO
cohen.avrahamOP
Sep 2023

G-d willing

Hello,
In Haskell there is the threadDelay command that suspends the thread for a certain time (in milliseconds).
Is there a function in DAML that achieves the same?

Thanks,

CO
cocreature
Sep 2023

There is sleep in Daml script. There is nothing that you can use within a transaction. If that’s your usecase could you explain what you’re trying to do? Note that getTime will never advance within a transaction. It’s fixed

CO
cohen.avraham
Sep 2023

G-d willing

Hi @cocreature,
I want to have a script that within a loop it creates contracts. And I don’t want them to get created right away, but after some delay in time. It is for testing purposes.

CO
cocreature
Sep 2023

Then sleep within your Daml script should work fine?

← Back to Discussions