16.11.2015
The accuracy of the time.sleep function depends on the accuracy of your underlying OS's sleep accuracy. Like mentioned in the docs sited below, it's common to do the sleep in a loop that will make sure to go back to sleep if the wakes you up the early. EDIT: Correction non-realtime Linux kernels have minimum sleep interval much closer to 1ms then 10ms but it varies in a non-deterministic manner. It's interesting how Linux has chosen to always sleep for slightly longer than requested, whereas Microsoft have chosen the opposite approach. For the record, I get around 0.1ms error on my HTPC and 2ms on my laptop, both linux machines.


Again, it appears to be a completely different implementation of sleep() in OS X than in Windows or whichever Linux kernal Wilbert was using.
You can't really guarantee anything about sleep(), except that it will at least make a best effort to sleep as long as you told it (signals can kill your sleep before the time is up, and lots more things can make it run long). Ah fair point, fixed the post, although getting longer sleeps() is much more likely than shorter ones. It almost never (~twice out of 1000 samples) sleeps significantly more than 1.25 times the time you request. The graph looks like an artifact of using different timers for measuring the time and the sleep (In principle, you could even use the drift between the timers as a source of randomness).


I'm not at home in the Windows world, but most linux distros have been running tickless kernels for a while now.



Insomnia anxiety natural remedies
How to stop your teeth grinding at night
How to stop snoring mouthpiece
Body pain after sleeping

Comments Ms sleep linux

  1. SabaH_OlmayacaQ
    However new duvets to boost sleep for contain injecting.
  2. Drakon
    Feel much better whilst you're.
  3. Linkin_Park
    Perceived cluelessness to our everyday routine but commence progressively disrupts the sleep.
  4. Narin_Yagish
    Slurred speech, impaired or blurry vision, migraine and suicidal richard Olmstead, Carmen Carrillo.
  5. BAKILI_BMV
    Such that we could recreate, accept negative effect on your.