Inaccurate time.sleep() with Python 3.x and Windows 7
问题 Following on from this post, I've identified a non-functional implementation of Python's time.sleep() function under Windows 7 (Enterprise, 64-bit and Python 3.4.4). Here's the reference .py script: import threading, time def Return(): return def Setup(): for _ in range(10): time_before = time.time() Return() wait_delay = -time.time() delays = [] InputFrequency = 60 while (time.time() - time_before) < (1 / InputFrequency): time.sleep(0) wait_delay += time.time() delays.append(wait_delay)