mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 11:52:32 +01:00
- fix timer Util_GetHPCTime precision issues
This commit is contained in:
parent
51b5e84f9a
commit
4cb68d8e54
@ -33,7 +33,7 @@ double Util_GetHPCTime(timerCtx_t* timer, int reset)
|
|||||||
|
|
||||||
gettimeofday(&curr, NULL);
|
gettimeofday(&curr, NULL);
|
||||||
|
|
||||||
double value = (float(curr.tv_sec - timer->timeStart.tv_sec) + 0.000001f * float(curr.tv_usec - timer->timeStart.tv_usec));
|
double value = (double(curr.tv_sec - timer->timeStart.tv_sec) + double(curr.tv_usec - timer->timeStart.tv_usec) * 0.000001);
|
||||||
|
|
||||||
if (reset)
|
if (reset)
|
||||||
timer->timeStart = curr;
|
timer->timeStart = curr;
|
||||||
|
Loading…
Reference in New Issue
Block a user