mirror of
https://github.com/skeeto/endlessh.git
synced 2025-12-08 14:13:23 +00:00
Use vDSO for the clock on Linux
This commit is contained in:
@@ -29,7 +29,11 @@ static long long
|
||||
uepoch(void)
|
||||
{
|
||||
struct timespec tv;
|
||||
#ifdef __linux__
|
||||
clock_gettime(CLOCK_REALTIME_COARSE, &tv);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &tv);
|
||||
#endif
|
||||
return tv.tv_sec * 1000ULL + tv.tv_nsec / 1000000ULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user