rcore_platform_sdl: Fix GetTime() resolution for sdl (#5653)

`SDL_GetTicks()` only has millisecond resolution so switched to
`SLD_GetPerformanceCounter()` combined with
`SDL_GetPerformanceFrequency()` which should allow more granular timing

Fix: remove intermediate  variable

Remove second cast
This commit is contained in:
Soma Mizobuchi
2026-03-15 15:31:18 -04:00
committed by GitHub
parent fd017c0b2d
commit 29280971be

View File

@@ -1276,9 +1276,7 @@ void SwapScreenBuffer(void)
// Get elapsed time measure in seconds
double GetTime(void)
{
unsigned int ms = SDL_GetTicks(); // Elapsed time in milliseconds since SDL_Init()
double time = (double)ms/1000;
return time;
return (double)SDL_GetPerformanceCounter() / SDL_GetPerformanceFrequency();
}
// Open URL with default system browser (if available)