Using timeBeginPeriod
and CreateTimerQueueTimer
has been working for me quite long on the few computers I used it to get a timer with e.g. 1 ms resolution, but now I came across several other computers, where this does not work anymore and I only get a 16 ms resolution.
Not sure if that's relevant: The computers on which it is working as excepted and on which it is not working all run the same Windows 10 21H2 with the same antimalware and are administrated by the same department.
I use basically the same code as in this Microsoft example together with a timeBeginEvent(1)
.
Interestingly, clockres64
from Sysinternals reports Current timer interval: 1.000 ms
, and powercfg -energy duration 5
lists my app with the information Requested Period 10000
, still the resolution is 16 ms.
What am I missing, which other API function do I have to call to get a timer with a 1 ms resolution?
Update: Same behavior when using NtSetTimerResolution
.