I have multiple threads running. I want them to start with delay timer of 5 seconds. For ex: Thread1 starts with t seconds, Thread2 starts with t+5 seconds, Tread3 starts with t+10 seconds and so on. How can I do this, by changing the code below ...
from threading import Thread
import time
def Device(i):
print "Thread%d starts in %d" %(i, time.time())
# Thread1 needs to start with t seconds
# Thread2 needs to start with t+5 seconds
# Thread3 needs to start with t+10 seconds
.......
for i in range(100):
t = Thread(target=Device, args=(i,))
t.start()
- - , .
.
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 308
تاريخ: جمعه
25 تير
1395 ساعت: 14:28