mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-19 22:10:52 +00:00
Added SDL_DelayPrecise()
SDL_DelayNS() now passes through to the high precision OS delay function, and SDL_DelayPrecise() tries to busy wait to get as close as possible to the desired wait time. Fixes https://github.com/libsdl-org/SDL/issues/11141
This commit is contained in:
@@ -657,6 +657,11 @@ void SDL_Delay(Uint32 ms)
|
||||
}
|
||||
|
||||
void SDL_DelayNS(Uint64 ns)
|
||||
{
|
||||
SDL_SYS_DelayNS(ns);
|
||||
}
|
||||
|
||||
void SDL_DelayPrecise(Uint64 ns)
|
||||
{
|
||||
Uint64 current_value = SDL_GetTicksNS();
|
||||
Uint64 target_value = current_value + ns;
|
||||
|
||||
Reference in New Issue
Block a user