mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
16 lines
237 B
Nim
16 lines
237 B
Nim
|
|
import threadpool, os
|
|
|
|
proc single(time: int) =
|
|
sleep time
|
|
echo time
|
|
|
|
proc sleepsort(nums: openArray[int]) =
|
|
parallel:
|
|
var i = 0
|
|
while i <= len(nums) + -1:
|
|
spawn single(nums[i])
|
|
i += 1
|
|
|
|
sleepsort([50,3,40,25])
|