mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-24 15:53:58 -04:00
REVIEWED: GetTime(), make sure division is with doubles #5668
This commit is contained in:
@ -1276,7 +1276,7 @@ void SwapScreenBuffer(void)
|
|||||||
// Get elapsed time measure in seconds
|
// Get elapsed time measure in seconds
|
||||||
double GetTime(void)
|
double GetTime(void)
|
||||||
{
|
{
|
||||||
double time = (double)(SDL_GetPerformanceCounter()/SDL_GetPerformanceFrequency()) - CORE.Time.base;
|
double time = ((double)SDL_GetPerformanceCounter()/(double)SDL_GetPerformanceFrequency()) - CORE.Time.base;
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
@ -2125,7 +2125,7 @@ int InitPlatform(void)
|
|||||||
// Initialize timing system
|
// Initialize timing system
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Get base time from window initialization
|
// Get base time from window initialization
|
||||||
CORE.Time.base = (double)(SDL_GetPerformanceCounter()/SDL_GetPerformanceFrequency());
|
CORE.Time.base = (double)SDL_GetPerformanceCounter()/(double)SDL_GetPerformanceFrequency();
|
||||||
|
|
||||||
#if defined(_WIN32) && SUPPORT_WINMM_HIGHRES_TIMER && !SUPPORT_BUSY_WAIT_LOOP
|
#if defined(_WIN32) && SUPPORT_WINMM_HIGHRES_TIMER && !SUPPORT_BUSY_WAIT_LOOP
|
||||||
SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "1"); // SDL equivalent of timeBeginPeriod() and timeEndPeriod()
|
SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "1"); // SDL equivalent of timeBeginPeriod() and timeEndPeriod()
|
||||||
|
|||||||
Reference in New Issue
Block a user