mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 00:32:46 +00:00
Merge pull request #10173 from Alcaro/patch-1
Avoid overflow when calculating multiplying performance counter
This commit is contained in:
commit
ad03277e3c
@ -225,7 +225,7 @@ retro_time_t cpu_features_get_time_usec(void)
|
||||
|
||||
if (!QueryPerformanceCounter(&count))
|
||||
return 0;
|
||||
return count.QuadPart * 1000000 / freq.QuadPart;
|
||||
return (count.QuadPart / freq.QuadPart * 1000000) + (count.QuadPart % freq.QuadPart * 1000000 / freq.QuadPart);
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
return sys_time_get_system_time();
|
||||
#elif defined(GEKKO)
|
||||
|
Loading…
x
Reference in New Issue
Block a user