Sleep Sort sleep-sort works by creating a task for every number to be sorted. The task will "sleep" n number of milliseconds and then push the number onto an array. When all tasks are done, the array is returned sorted.