Is there an equivalent for threadDelay

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,

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

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.

Then sleep within your Daml script should work fine?

1 Like