The current model reduces precision/resolution on Windows to 1ms between rate-limited Ticks. This is unacceptable.
New Algorithm should work like this:
1) Determine how many Milliseconds we can allow the Thread to rest for between the current and next Tick (this may be 0, if the rest time is less than 1ms)
2) Sleep for that duration
3) For the remaining time, spin a "Live Wait" (which will keep the Thread active, but will be precise to the absolute precision of the system clock).
The current model reduces precision/resolution on Windows to 1ms between rate-limited Ticks. This is unacceptable.
New Algorithm should work like this:
1) Determine how many Milliseconds we can allow the Thread to rest for between the current and next Tick (this may be 0, if the rest time is less than 1ms) 2) Sleep for that duration 3) For the remaining time, spin a "Live Wait" (which will keep the Thread active, but will be precise to the absolute precision of the system clock).