SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Windows timer improvements

Open slouken opened this issue 3 years ago • 1 comments
trafficstars

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.

slouken avatar Nov 23 '22 18:11 slouken

Are there multiple timers? like ` timer = SDL_TimerInit()

SDL_AddTimer(timer,...) `

baidwwy avatar Dec 03 '22 01:12 baidwwy

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.

RT2Code avatar Mar 11 '23 12:03 RT2Code

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()

slouken avatar Mar 11 '23 23:03 slouken

Never mind then, I struggle to keep up with all the awesome work you guys are doing on the SDL3.

RT2Code avatar Mar 11 '23 23:03 RT2Code