Thank you for your reply. It went perfectly well.
import times, asyncdispatch, os, strformat
proc sleepEcho(time: int) {.async.} =
await sleepAsync(time)
echo "slept for ", time, "ms"
let a = sleepEcho(2)
let b = sleepEcho(3)
let starttime = epochTime()
while true:
poll()
if a.finished and b.finished:
break
echo fmt"Time taken: {(epochTime() - starttime)*1000:.2f}(ms)"
Run
- Running multiple sleeps as Async Allosteric
- Re: Running multiple sleeps as Async dom96
- Re: Running multiple sleeps as Async Allosteric
