mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-22 20:59:54 +00:00
16 lines
224 B
Nim
16 lines
224 B
Nim
import asyncdispatch
|
|
|
|
proc task() {.async.} =
|
|
await sleepAsync(40)
|
|
|
|
proc main() =
|
|
var counter = 0
|
|
var f = task()
|
|
while not f.finished:
|
|
inc(counter)
|
|
poll(10)
|
|
|
|
doAssert counter <= 4
|
|
|
|
for i in 0 .. 10: main()
|