nim-chronos/tests/test3.nim

11 lines
180 B
Nim
Raw Normal View History

2018-05-16 08:22:34 +00:00
import asyncdispatch2
proc task() {.async.} =
await sleepAsync(1000)
proc waitTask() {.async.} =
echo await withTimeout(task(), 100)
when isMainModule:
waitFor waitTask()