osal
osal copied to clipboard
Switch to waitable timers for sleep
This improves accuracy compared to sleep.
This make use of high resolution timers on modern windows machines to ensure timers as well as sleeps are close to 1 ms accurate, without raising the global tick interval.
In theory it should allow more than 1ms accuracy however, it seem to generally be limited to around 0.6 ms in testing.
Note. Requires windows 10.