mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-21 10:43:36 +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:
committed by
Ryan C. Gordon
parent
49879ba0d6
commit
e575093c83
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user