5 ms·
Alternatively there is everybody's favorite CreateThreadpoolTimer https://learn.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-creat
by leeter 2y ago
Alternatively there is everybody's favorite CreateThreadpoolTimer https://learn.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-createthreadpooltimer https://learn.microsoft.com/en-us/windows/win32/api/threadpo... now that the threadpool is active on any Win32 process by default AFAIK. But for something you don't mind blocking the above is often easier to use.
- tom_ 2y agoWhew, so we've got CreateWaitableTimer, CreateTimerQueueTimer from another comment, and now CreateThreadpoolTimer as well. But that's not all - we already had WM_TIMER from the article. TFA says POSIX has one type of timer, and it sucks. Windows has 4 types... but how many of them suck? I've used CreateWaitableTimer, and it was alright. I do know WM_TIMER sucks, but I've never used CreateTimerQueueTimer or CreateThreadpoolTimer. So, worst case is a draw. I'd like to see Windows winning here though.