Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created October 4, 2014 01:07
Show Gist options
  • Save jordanorelli/2bdff5191b9b51281ad9 to your computer and use it in GitHub Desktop.
Save jordanorelli/2bdff5191b9b51281ad9 to your computer and use it in GitHub Desktop.
from time import sleep, time
from threading import Thread
class Worker(Thread):
def run(self):
count = 0
while True:
print "worker says hi. %r" % time()
sleep(0.1)
w = Worker()
w.daemon = True
w.start()
count = 0
while True:
print "main says hi. %r" % time()
count += 1
if count < 10:
sleep(0.08)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment