For Windows, you can use CreateWaitableTimer to create a timer that doesn't need a window: https://learn.microsoft.com/en-us/windows/win32/api/synchapi...
Wait for it to time out using one of the WaitFor family of functions.
Wait for it to time out using one of the WaitFor family of functions.
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.