import time SLEEP = 50 def tick(): start = time.perf_counter() # hi-resolution timer (in seconds) # do something ... elapsed = int(1000 * (time.perf_counter() - start)) # milliseconds turtle.ontimer(tick, max(0, SLEEP - elapsed))
| ZhangZhihui's Blog |
|
||
![]() |
|
|
博客园
|
|