2 ms·
Hm, minimum OS scheduler timestep is usually around 1000hz, right? How do gaming mice go above that? I’ve seen up to 8000hz..
by rjeli 5y ago
Hm, minimum OS scheduler timestep is usually around 1000hz, right? How do gaming mice go above that? I’ve seen up to 8000hz..
- prewett 5y agoEvents just get put into a queue, and somewhere in the guts of the application there will be a loop that does: while (stillRunning) { event = getEventOrWait(); // handle event } (In macOS this is done inside [NSApp run], but Windows and Linux make the loop explicit.) I think the 1000 Hz you are thinking of is the accuracy of the UI timers. Since you're just calling this in a loop, not waiting for a timer to fire, you can burn through a lot of events in one timeslice. And since most systems have multiple processors, it is reasonable for your game to be running continually, especially since modern OSes frequently prioritize certain kinds of programs (and a game might request prioritization if at all possible).