1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
discard """ file: "t6100.nim" exitcode: 0 output: "10000000" """ import asyncdispatch let done = newFuture[int]() done.complete(1) proc asyncSum: Future[int] {.async.} = for _ in 1..10_000_000: result += await done echo waitFor asyncSum()