So, sure, if you change Windows timer interrupt frequency, that's what you get. It'll of course also affect Sleep while active. Back to the square one.
And very alarming.
On Win10/1809 timeBeginPeriod does affect SetWaitableTimer resolution, as I'd have expected.
On Win10/2004 timeBeginPeriod doesn't seem to affect SetWaitableTimer resolution?! This could certainly break things!
SetWaitableTimer documentation lets you understand timeBeginPeriod is expected to affect the resolution. Of course, depending on hardware... but in this case both tests were running on same hardware.
"You can change the resolution of your API with a call to the timeBeginPeriod and timeEndPeriod functions. How precise you can change the resolution depends on which hardware clock the particular API uses. For more information, check your hardware documentation."
https://docs.microsoft.com/en-us/windows/win32/api/synchapi/...
On 1809 same took about 1.3 seconds.
I'm at loss... Windows timers have yet again managed to do really weird, unexpected things.
I really hope this mess doesn't affect device drivers, or there could be a world of hurt coming up.
Edit: Never mind. Seems it might not be the APCs. Maybe some callee of Sleep(Ex) is just rounding up the wait interval to a time slice somewhere. Not sure... would need some digging.
> clockres && Temp
Maximum timer interval: 15.625 ms
Minimum timer interval: 0.500 ms
Current timer interval: 15.621 ms
0
15
16
...
16
15
2
1
2
...Re: your troubleshooting: wild guess, but one thing to look into (if you ever encounter it again) might be changing the "Processor scheduling" setting in sysdm.cpl -> Advanced -> Settings #1 -> Advanced to "Programs" instead of "Background services". Not sure if that affects timers, but I can't think of much else (besides the hypervisor or hard-coded kernel differences) that would cause this.
Really? On versions prior to 20H2? This gives me 16ms resolution for SetWaitableTimer but 1ms for timeSetEvent: