light/modules/time/private/timer.cpp

20 lines
290 B
C++
Raw Normal View History

#include <time/timer.hpp>
2025-07-05 13:28:41 +03:30
2025-07-11 00:05:48 +03:30
namespace lt {
2025-07-05 13:28:41 +03:30
Timer::Timer(Timepoint start): m_start(start)
2025-07-05 13:28:41 +03:30
{
}
void Timer::reset(Timepoint start)
{
m_start = start;
}
[[nodiscard]] auto Timer::elapsed_time() const -> Duration
{
return { std::chrono::steady_clock::now() - m_start };
}
2025-07-11 00:05:48 +03:30
} // namespace lt