Created
October 3, 2017 21:42
-
-
Save jornane/81f0edcebbafbcf1605a9a0fe9034152 to your computer and use it in GitHub Desktop.
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
import time | |
for i in range(1, 1000): | |
i = i / 1000.0 | |
then = time.time() | |
time.sleep(max(0, i - 0.005)) | |
now = time.time() | |
while now - then - i < 0: | |
now = time.time() | |
print(round(now - then - i, 5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment