Sorting algorithms/Sleep sort: Difference between revisions

Add Julia
(Add Julia)
Line 681:
</pre>
 
=={{header|Julia}}==
<lang Julia>input = [3,2,4,7,3,6,9,1]
output = Int[]
 
@sync for i in input
@async begin
sleep(i)
push!(output, i)
end
end
 
@assert output == sort(input)
println(output)</lang>
{{out}}
<pre>[1,2,3,3,4,6,7,9]</pre>
=={{header|Lua}}==
Here's a slow implementation using only stock C Lua: