mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-26 02:58:57 +00:00
14 lines
191 B
Nim
14 lines
191 B
Nim
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
|