RosettaCodeData/Task/Concurrent-computing/Python/concurrent-computing-4.py

9 lines
167 B
Python
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
import threading
2019-09-12 10:33:56 -07:00
import random
2013-04-10 16:57:12 -07:00
2019-09-12 10:33:56 -07:00
def echo(text):
print(text)
2013-04-10 16:57:12 -07:00
2019-09-12 10:33:56 -07:00
for text in ["Enjoy", "Rosetta", "Code"]:
threading.Timer(random.random(), echo, (text,)).start()