Skip to content

Comment on The missing cross-platform OS API for timersparent

Comments

WM_TIMER has a flaw the author is not aware of. It is a low priority event that yields to pretty much all other events in the message loop.

Meaning if a user is busy jerking off a mouse which is causing WM_MOUSEMOVE events, the WM_TIMER will never fire at the expected time.

There is a hack to peek the next event specifically looking for WM_TIMER, on every other event call, which would trigger it on the queue.

https://devblogs.microsoft.com/oldnewthing/20191108-00/?p=10...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.