Skip to content
CCPEDIAby Unity Nodes
App Development

Is there an equivalent for threadDelay

4 posts253 views1 likesLast activity Sep 2023

  1. cohen.avrahamOP

    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,

  2. cocreature

    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

  3. cohen.avraham

    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.

  4. cocreature 1

    Then sleep within your Daml script should work fine?