From 7dccf72342ab2bceed65ecb46535a5a8b652da1c Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sat, 15 Mar 2025 11:34:53 +0100 Subject: [PATCH] chore(performance_monitor): assert clock_gettime() return value --- src/performance_monitor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/performance_monitor.cpp b/src/performance_monitor.cpp index 45779a27..e30ffb70 100644 --- a/src/performance_monitor.cpp +++ b/src/performance_monitor.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -183,7 +184,8 @@ class performance_monitor_impl final : public performance_monitor { return ticks.QuadPart; #else struct timespec ts; - ::clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + auto rv [[maybe_unused]] = ::clock_gettime(CLOCK_MONOTONIC_RAW, &ts); + assert(rv == 0); return UINT64_C(1'000'000'000) * ts.tv_sec + ts.tv_nsec; #endif }