diff --git a/test/utf_converters_test.cpp b/test/utf_converters_test.cpp index ef78e7a..3b00dc2 100644 --- a/test/utf_converters_test.cpp +++ b/test/utf_converters_test.cpp @@ -52,6 +52,8 @@ #if defined(__linux__) || defined(__APPLE__) #include +#include +#include #if defined(__MACH__) #include @@ -573,6 +575,11 @@ uint64_t get_time() throw() "mrs %0, cntvct_el0\n\t" : "=r" (cntvct_el0) : : ); return cntvct_el0; +#elif defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 + struct timespec tp; + if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) + std::abort(); + return static_cast(tp.tv_sec) * 1000000000ull + tp.tv_nsec; #else #error Unsupported architecture #endif