From 44b3532e07d2e3790a75ccd5a75f19deefa71e82 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 1 Mar 2015 23:57:01 -0500 Subject: Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X). On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass. --- gpsutils.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gpsutils.c') diff --git a/gpsutils.c b/gpsutils.c index fa15bc49..e7000f70 100644 --- a/gpsutils.c +++ b/gpsutils.c @@ -299,15 +299,9 @@ void gps_merge_fix( /*@ out @*/ struct gps_fix_t *to, * near microSec. Do not use near PPS which is nanoSec precise */ timestamp_t timestamp(void) { -#ifdef HAVE_CLOCK_GETTIME struct timespec ts; /*@i2@*/(void)clock_gettime(CLOCK_REALTIME, &ts); /*@i3@*/return (timestamp_t)(ts.tv_sec + ts.tv_nsec * 1e-9); -#else - struct timeval tv; - (void)gettimeofday(&tv, NULL); - return (timestamp_t)(tv.tv_sec + tv.tv_usec * 1e-6); -#endif } time_t mkgmtime(register struct tm * t) -- cgit v1.2.1