RosettaCodeData/Task/Concurrent-computing/Nim/concurrent-computing-3.nim

10 lines
140 B
Nim
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
import threadpool
const str = ["Enjoy", "Rosetta", "Code"]
proc f(i) {.thread.} =
echo str[i]
for i in 0..str.high:
spawn f(i)
sync()