Slightly rework AudioUtilsGetCurrentTimeInMs not to lose precision

This commit is contained in:
Silent 2019-12-06 21:01:22 +01:00
parent 8d9ba3a97a
commit 49ab1a5ed8
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -1230,7 +1230,6 @@ static LARGE_INTEGER UtilsFrequency;
static BOOL WINAPI AudioUtilsFrequency( PLARGE_INTEGER lpFrequency )
{
::QueryPerformanceFrequency( &UtilsFrequency );
UtilsFrequency.QuadPart /= 1000;
lpFrequency->QuadPart = UtilsFrequency.QuadPart;
return TRUE;
}
@ -1253,7 +1252,7 @@ static int64_t AudioUtilsGetCurrentTimeInMs()
LARGE_INTEGER currentTime;
QueryPerformanceCounter( &currentTime );
return (currentTime.QuadPart - UtilsStartTime.QuadPart) / UtilsFrequency.QuadPart;
return ((currentTime.QuadPart - UtilsStartTime.QuadPart) * 1000) / UtilsFrequency.QuadPart;
}
// Minimal HUD changes