Skip to content

Instantly share code, notes, and snippets.

@ufechner7
Created August 23, 2015 19:36
Show Gist options
  • Save ufechner7/1aa3e96a8a5972864cec to your computer and use it in GitHub Desktop.
Save ufechner7/1aa3e96a8a5972864cec to your computer and use it in GitHub Desktop.
from datetime import datetime
import time
def check_sleep(amount):
start = datetime.now()
time.sleep(amount)
end = datetime.now()
delta = end-start
return delta.seconds + delta.microseconds/1000000.
error = sum(abs(check_sleep(0.050)-0.050) for i in xrange(100))*10
print "Average error is %0.2fms" % error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment