mirror of
https://git.freebsd.org/ports.git
synced 2025-06-29 08:30:37 -04:00
CLOCK_MONOTONIC is available. - If FreeBSD-specific CLOCK_MONOTONIC_FAST is available, use it instead of precise but slow gettimeofday(2) or CLOCK_MONOTONIC. Reviewed by: stable, x11
14 lines
432 B
C
14 lines
432 B
C
--- os/utils.c.orig 2007-08-23 15:04:55.000000000 -0400
|
|
+++ os/utils.c 2008-02-29 13:11:01.000000000 -0500
|
|
@@ -525,7 +525,11 @@
|
|
|
|
#ifdef MONOTONIC_CLOCK
|
|
struct timespec tp;
|
|
+#if defined(__FreeBSD__) && defined(CLOCK_MONOTONIC_FAST)
|
|
+ if (clock_gettime(CLOCK_MONOTONIC_FAST, &tp) == 0)
|
|
+#else
|
|
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
|
|
+#endif
|
|
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
|
|
#endif
|
|
|