Skip to content

Instantly share code, notes, and snippets.

@gbnk0
Created May 19, 2016 14:26
Show Gist options
  • Save gbnk0/b7e293821994ba758bef5008eb5fab4f to your computer and use it in GitHub Desktop.
Save gbnk0/b7e293821994ba758bef5008eb5fab4f to your computer and use it in GitHub Desktop.
import time
from threading import Thread
def myfunc(i):
print "sleeping 5 sec from thread %d" % i
time.sleep(5)
print "finished sleeping from thread %d" % i
for i in range(10):
t = Thread(target=myfunc, args=(i,))
t.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment