SDL_DelayNS() will attempt to sleep exactly the requested amount of time

This provides a highly accurate sleep function for your application, although you are still subject to being switched out occasionally.

Fixes https://github.com/libsdl-org/SDL/issues/10210
This commit is contained in:
Sam Lantinga
2024-07-15 18:05:31 -07:00
parent 54366181c3
commit 033df70d4c
12 changed files with 62 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ Uint64 SDL_GetPerformanceFrequency(void)
return kBUSCLK;
}
void SDL_DelayNS(Uint64 ns)
void SDL_SYS_DelayNS(Uint64 ns)
{
struct timespec tv;
tv.tv_sec = (ns / SDL_NS_PER_SECOND);