SDL
SDL copied to clipboard
Windows timer improvements
From https://github.com/libsdl-org/SDL/pull/6232#issuecomment-1311871498: We switched to this recently (https://github.com/ppy/osu-framework/pull/5501). One weak recommendation would be to consider falling back to using waitable timers minus the HIGH_RESOLUTION flag where it isn't supported (<= win10b1803) as it still seems to be beneficial.
Of note I haven't yet actually tested on older windows builds, but at very least on windows 11 both with and without the HIGH_RESOLUTION flag work quite well.
--
We should also make the timer handle persist in thread-local storage so we don't allocate and free them continuously.
Are there multiple timers? like ` timer = SDL_TimerInit()
SDL_AddTimer(timer,...) `
Also, as the improved timer accuracy minimum precision is about 500 µs, the SDL_Delay function parameter should be specified in µs instead of ms to benefit from it.
Also, as the improved timer accuracy minimum precision is about 500 µs, the SDL_Delay function parameter should be specified in µs instead of ms to benefit from it.
We added a new API, SDL_DelayNS()
Never mind then, I struggle to keep up with all the awesome work you guys are doing on the SDL3.