summary refs log tree commit diff stats
path: root/tests/async/t6100.nim
blob: b4dc0f1469d2b317bb074a26c93bcfe9a4fc9f48 (plain) (blame)
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()