accurate_time.py 303 B

12345678910111213
  1. import time as python_time
  2. import sys
  3. def time():
  4. if sys.version_info[0] == 2 and sys.platform == "win32":
  5. # better precision on windows, but deprecated since 3.3
  6. return python_time.clock()
  7. else:
  8. return python_time.perf_counter()
  9. def sleep(t):
  10. python_time.sleep(t)