Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.34 KB | None | 0 0
  1. import threadpool, os
  2.  
  3.  
  4. proc testB(x:int) =
  5.     for i in 11..20 :
  6.         #sleep(1)
  7.         echo "Running testB(",x,") i = ",i
  8.  
  9.  
  10. proc testA(x:int) =
  11.     spawn testB(x)
  12.     spawn testB(x+1)
  13.     spawn testB(x+2)
  14.     for i in 1..10 :
  15.         echo "Running testA(",x,") i = ",i
  16.  
  17.  
  18. spawn testA(0)
  19. spawn testA(10)
  20. spawn testA(20)
  21.  
  22.  
  23. sync()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement