timer.cpp: fix order of operations issue with timerUpdate()

git-svn-id: https://svn.eduke32.com/eduke32@8018 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2019-08-15 07:14:46 +00:00 committed by Christoph Oelckers
parent 2895b36b72
commit fd41554ad7

View file

@ -38,7 +38,7 @@ ATTRIBUTE((flatten)) void timerUpdate(void)
{
auto time = steady_clock::now();
auto elapsedTime = time - timerlastsample;
int n = elapsedTime.count() * (uint64_t) timerticspersec / timerGetFreqU64() * steady_clock::period::num;
int n = (elapsedTime.count() * (uint64_t) timerticspersec * steady_clock::period::num) / timerGetFreqU64();
if (n <= 0) return;