bazarr/scheduler.py

13 lines
294 B
Python
Raw Normal View History

2017-10-16 23:27:19 +00:00
import datetime, threading, time
def foo():
next_call = time.time()
while True:
print datetime.datetime.now()
next_call = next_call+1;
time.sleep(next_call - time.time())
timerThread = threading.Thread(target=foo)
timerThread.daemon = True
timerThread.start()