4 ms·
Linux and MinGW can just use nanosleep(). As for Windows, use CreateWaitableTimerEx, with a CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag.
by Deukhoofd 4y ago
Linux and MinGW can just use nanosleep().
As for Windows, use CreateWaitableTimerEx, with a CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag.
- leeter 4y agoWindows can also use beginTimePeriod() to set the timer resolution (sadly system wide) so if one needs a 1ms time period that is plausible with defaults. But you do have to set it. Otherwise you have to depend on the variable tick timer to give you want you want. Which don't get me wrong can be good, but if you need more guaranteed timer ticks... it may not be the way. https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod https://docs.microsoft.com/en-us/windows/win32/api/timeapi/n...