[hal] Simplify monotonic_clock (#8678)

The epoch() function, zero() function, and min_time member are all not
part of the std::chrono clock interface.

The default constructor of time_point is
[documented](https://en.cppreference.com/w/cpp/chrono/time_point/time_point.html)
to initialize to the clock's epoch.
This commit is contained in:
Tyler Veness
2026-03-15 20:42:52 -07:00
committed by GitHub
parent 14e2c1c4cf
commit 86dd3ca2b7
2 changed files with 6 additions and 13 deletions

View File

@@ -66,8 +66,7 @@ class Tracer {
static constexpr std::chrono::milliseconds kMinPrintPeriod{1000};
wpi::hal::monotonic_clock::time_point m_startTime;
wpi::hal::monotonic_clock::time_point m_lastEpochsPrintTime =
wpi::hal::monotonic_clock::epoch();
wpi::hal::monotonic_clock::time_point m_lastEpochsPrintTime;
wpi::util::StringMap<std::chrono::nanoseconds> m_epochs;
};