forked from extern/endlessh
Don't use CLOCK_REALTIME_COARSE
The resolution only seems to be around 4ms.
This commit is contained in:
parent
516d0cd78c
commit
6199d648f5
@ -28,11 +28,7 @@ static long long
|
|||||||
uepoch(void)
|
uepoch(void)
|
||||||
{
|
{
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
#ifdef __linux__
|
|
||||||
clock_gettime(CLOCK_REALTIME_COARSE, &tv);
|
|
||||||
#else
|
|
||||||
clock_gettime(CLOCK_REALTIME, &tv);
|
clock_gettime(CLOCK_REALTIME, &tv);
|
||||||
#endif
|
|
||||||
return tv.tv_sec * 1000ULL + tv.tv_nsec / 1000000ULL;
|
return tv.tv_sec * 1000ULL + tv.tv_nsec / 1000000ULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user