mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-22 14:01:55 +00:00
Fix Apple performance frequency to match nanosecond counter
The counter returns ns via clock_gettime_nsec_np, so the frequency must be SDL_NS_PER_SECOND.
This commit is contained in:
parent
49879ba0d6
commit
e575093c83
1 changed files with 1 additions and 4 deletions
|
|
@ -128,10 +128,7 @@ Uint64 SDL_GetPerformanceFrequency(void)
|
|||
#ifdef HAVE_CLOCK_GETTIME
|
||||
return SDL_NS_PER_SECOND;
|
||||
#elif defined(SDL_PLATFORM_APPLE)
|
||||
Uint64 freq = mach_base_info.denom;
|
||||
freq *= SDL_NS_PER_SECOND;
|
||||
freq /= mach_base_info.numer;
|
||||
return freq;
|
||||
return SDL_NS_PER_SECOND;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue