Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-11-23 01:06:58 +0300
committerJean-Baptiste Kempf <jb@videolan.org>2019-11-24 11:24:42 +0300
commitcf4b381ac772978b3179657475b9fdfb8b17c629 (patch)
tree9dc9fa3e5b4af30f91042b4f5fcbc8973b4998e9 /tools
parenteaa3be9a841943389f43991c3edabde54f62350f (diff)
tools: prefer mach_absolute_time on macOS for forward compatibility
Diffstat (limited to 'tools')
-rw-r--r--tools/dav1d.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/dav1d.c b/tools/dav1d.c
index b171c05..47b453f 100644
--- a/tools/dav1d.c
+++ b/tools/dav1d.c
@@ -63,14 +63,14 @@ static uint64_t get_time_nanos(void) {
LARGE_INTEGER t;
QueryPerformanceCounter(&t);
return 1000000000 * t.QuadPart / frequency.QuadPart;
-#elif defined(HAVE_CLOCK_GETTIME)
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- return 1000000000ULL * ts.tv_sec + ts.tv_nsec;
#elif defined(__APPLE__)
mach_timebase_info_data_t info;
mach_timebase_info(&info);
return mach_absolute_time() * info.numer / info.denom;
+#elif defined(HAVE_CLOCK_GETTIME)
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return 1000000000ULL * ts.tv_sec + ts.tv_nsec;
#endif
}