Skip to content

Instantly share code, notes, and snippets.

@maxcountryman
Created June 20, 2011 13:27
Show Gist options
  • Save maxcountryman/1035597 to your computer and use it in GitHub Desktop.
Save maxcountryman/1035597 to your computer and use it in GitHub Desktop.
Sleep sort in Python
import thread
from time import sleep
items = [2, 4, 5, 2, 1, 7]
def sleep_sort(i):
sleep(i)
print i
[thread.start_new_thread(sleep_sort, (i,)) for i in items]
@armorasha
Copy link

Thanks. This code (Python 2) has been updated to Python 3 in my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment