From 2ce9e540da10d4d52ec8bf1defa9ccd45312e3b3 Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 28 Sep 2020 04:59:14 +0300 Subject: Use CLOCK_MONOTONIC_FAST when available (FreeBSD) CLOCK_MONOTONIC_FAST is the equivalent of Linux's CLOCK_MONOTONIC_RAW. --- src/skel/glfw/glfw.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/skel/glfw') diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 1217fc70..fbd40ba2 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -249,8 +249,10 @@ double psTimer(void) { struct timespec start; -#ifdef __linux__ +#if defined(CLOCK_MONOTONIC_RAW) clock_gettime(CLOCK_MONOTONIC_RAW, &start); +#elif defined(CLOCK_MONOTONIC_FAST) + clock_gettime(CLOCK_MONOTONIC_FAST, &start); #else clock_gettime(CLOCK_MONOTONIC, &start); #endif -- cgit v1.2.3