Sorting algorithms/Sleep sort: Difference between revisions

(Added AutoHotkey)
Line 992:
 
=={{header|Julia}}==
{{works with|Julia|01.6}}
 
<lang julia>function sleepsort(arrV::Vector{T}) where {T <: Real})
outU = Vector{eltype(arr)T}(0)
sizehint!(outU, length(arrV))
@sync for xv in arrV
@async begin
sleep(xabs(v))
(v < 0 ? pushfirst! : push!)(outU, xv)
end
end
return outU
end
 
 
 
v = rand(-10:10, 10)
Line 1,010 ⟶ 1,012:
 
{{out}}
<pre># unordered: [910, 5-1, 3, 8-9, 81, 2-5, 5-8, 2-7, 5-3, 53]
-> ordered: [2-9, 2-8, 3-7, -5, 5-3, 5-1, 51, 83, 83, 910]</pre>
 
=={{header|Kotlin}}==