Created
August 13, 2013 16:10
-
-
Save Xpktro/6222781 to your computer and use it in GitHub Desktop.
System-time synchronized timer in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import time | |
while True: | |
t = datetime.utcnow() | |
print '%s:%s:%s' % (t.hour, t.minute, t.second) | |
sleeptime = 1 - (t.microsecond/1000000.0) | |
time.sleep(sleeptime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment