mirror of https://github.com/xzeldon/htop.git
Add a fix to use gettimeofday if monotonic is not available.
This commit is contained in:
parent
ddfacb8694
commit
171aa0faaa
|
@ -49,9 +49,13 @@ void Generic_gettime_monotonic(uint64_t* msec) {
|
||||||
else
|
else
|
||||||
*msec = 0;
|
*msec = 0;
|
||||||
|
|
||||||
#else
|
#else /* lower resolution gettimeofday() should be always available */
|
||||||
|
|
||||||
# error "No monotonic clock available"
|
struct timeval tv;
|
||||||
|
if (gettimeofday(&tv, NULL) == 0)
|
||||||
|
*msec = ((uint64_t)tv.tv_sec * 1000) + ((uint64_t)tv.tv_usec / 1000);
|
||||||
|
else
|
||||||
|
*msec = 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue