rcore_platform_sdl: Fix GetTime() resolution for sdl

`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-13 23:53:45 -04:00
parent a6d5a7ffbc
commit cdb3f42998

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)