From f3e13193a610bbcc36960ded8a25793bcff873b6 Mon Sep 17 00:00:00 2001 From: Mozzarella32 <143010987+Mozzarella32@users.noreply.github.com> Date: Sat, 18 Oct 2025 13:34:07 +0200 Subject: [PATCH] timer: constify methods (#12079) --- src/helpers/time/Timer.cpp | 8 ++++---- src/helpers/time/Timer.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/helpers/time/Timer.cpp b/src/helpers/time/Timer.cpp index 95f75441..97338b31 100644 --- a/src/helpers/time/Timer.cpp +++ b/src/helpers/time/Timer.cpp @@ -6,18 +6,18 @@ void CTimer::reset() { m_lastReset = Time::steadyNow(); } -Time::steady_dur CTimer::getDuration() { +Time::steady_dur CTimer::getDuration() const { return Time::steadyNow() - m_lastReset; } -float CTimer::getMillis() { +float CTimer::getMillis() const { return chr::duration_cast(getDuration()).count() / 1000.F; } -float CTimer::getSeconds() { +float CTimer::getSeconds() const { return chr::duration_cast(getDuration()).count() / 1000.F; } const Time::steady_tp& CTimer::chrono() const { return m_lastReset; -} \ No newline at end of file +} diff --git a/src/helpers/time/Timer.hpp b/src/helpers/time/Timer.hpp index c21f78db..3d5e0197 100644 --- a/src/helpers/time/Timer.hpp +++ b/src/helpers/time/Timer.hpp @@ -5,12 +5,12 @@ class CTimer { public: void reset(); - float getSeconds(); - float getMillis(); + float getSeconds() const; + float getMillis() const; const Time::steady_tp& chrono() const; private: Time::steady_tp m_lastReset; - Time::steady_dur getDuration(); -}; \ No newline at end of file + Time::steady_dur getDuration() const; +};