mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
chore(performance_monitor): assert clock_gettime() return value
This commit is contained in:
parent
f6e760bfad
commit
7dccf72342
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <cassert>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@ -183,7 +184,8 @@ class performance_monitor_impl final : public performance_monitor {
|
|||||||
return ticks.QuadPart;
|
return ticks.QuadPart;
|
||||||
#else
|
#else
|
||||||
struct timespec ts;
|
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;
|
return UINT64_C(1'000'000'000) * ts.tv_sec + ts.tv_nsec;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user