Common/Timer: Add a SteadyAwakeClock class which counts non-suspended system running time.

This commit is contained in:
Jordan Woyak
2025-07-23 23:51:45 -05:00
parent 64d4c4020c
commit 62c773ac75
2 changed files with 49 additions and 0 deletions

View File

@@ -50,4 +50,19 @@ private:
#endif
};
// Similar to std::chrono::steady_clock except this clock
// specifically does *not* count time while the system is suspended.
class SteadyAwakeClock
{
public:
using rep = s64;
using period = std::nano;
using duration = std::chrono::duration<rep, period>;
using time_point = std::chrono::time_point<SteadyAwakeClock>;
static constexpr bool is_steady = true;
static time_point now();
};
} // Namespace Common