nim-chronos/tests/test2.nim

14 lines
191 B
Nim
Raw Normal View History

2018-05-16 11:22:34 +03:00
import asyncdispatch2
proc task() {.async.} =
await sleepAsync(10)
when isMainModule:
var counter = 0
var f = task()
while not f.finished:
inc(counter)
poll()
echo counter