Closed filipencopav closed 4 years ago
I asked this question and we seem to have found out a bug:
In the GetCurrentTime() function there is this bit of code:
GetCurrentTime()
... return (double)(GetTimeCount() - baseTime)/frequency*1000; ...
Frequency get initialized when InitTimer() is called, but there is a snip that might fail and it would remain 0:
InitTimer()
#if defined(__linux__) struct timespec now; if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) frequency = 1000000000; #endif
on linux, if clock_gettime() fails, frequency will remain 0, which will cause a division by 0 in GetCurrentTime()
clock_gettime()
Maybe initialize it with 1?
I asked this question and we seem to have found out a bug:
In the
GetCurrentTime()
function there is this bit of code:Frequency get initialized when
InitTimer()
is called, but there is a snip that might fail and it would remain 0:on linux, if
clock_gettime()
fails, frequency will remain 0, which will cause a division by 0 inGetCurrentTime()
Maybe initialize it with 1?