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 |
|
||
Copyright © 2024 ZhangZhihuiAAA
Powered by .NET 9.0 on Kubernetes |