Last active
January 10, 2017 03:04
-
-
Save thmosqueiro/1f9ef01e81e1ea719a863e7a6a17cec8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| key = True | |
| intrval = 0.050 | |
| for j in range(10000): | |
| while key: | |
| now = ( time.time() % 1 ) | |
| dif = intrval - now % intrval | |
| key = not ( dif < 0.005 ) | |
| time.sleep( dif*0.6 ) | |
| now = time.time() | |
| print now, ( intrval - ( now % 1 % 0.050 ) ) | |
| time.sleep(0.005) | |
| key = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment