On Thu Feb 20 21:47:59 2025 +0000, Paul Gofman wrote:
Sorry, I still don't understand what's going on with the game. timeBeginPeriod() can only set 1ms resolution as best (does game do that?), and thus SleepEx() will go with 1ms sleep granularity, as I understand from your message, that's also the case on Wine? If the change helps the game but it is not what happens on Windows the actual problem might be elsewhere.
Due to the `timeout_t diff = (-timeout->when - monotonic_time + 9999) / 10000;` in `get_next_timeout()`, the `SleepEx(1, TRUE)` calls can last longer due to this `monotonic_time` variable being updated by other threads' server calls, which puts it into the future by up to 1ms. That makes the sleep calls last "unexpectedly" longer depending on how fast you move the mouse, and not just because of increased load.