Skip to content

Instantly share code, notes, and snippets.

@1f0
Created July 19, 2019 06:10
Show Gist options
  • Save 1f0/25b68ce7b9a15da2175b116674739378 to your computer and use it in GitHub Desktop.
Save 1f0/25b68ce7b9a15da2175b116674739378 to your computer and use it in GitHub Desktop.
import threading
import time
def test(x):
def task():
while 1:
print(x)
time.sleep(x)
y = threading.Thread(target=task)
y.start()
return y
t = test(3)
t2 = test(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment