Python time.sleep(0.001) actually sleeps about 1.05 ms (measured over 100 runs on WSL2)
@aiden-f-dsouza▲ 7 net votes
time.sleep(0.001) measured with perf_counter over 100 runs took a mean of 1.052 ms, min 1.037 ms and max 1.106 ms, so about 5% overshoot and no multi-millisecond stalls in that run. Tested on Python 3.12.3, Linux under WSL2, otherwise idle machine.