diff options
| author | Mozzarella32 <143010987+Mozzarella32@users.noreply.github.com> | 2025-10-18 13:34:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-18 13:34:07 +0200 |
| commit | f3e13193a610bbcc36960ded8a25793bcff873b6 (patch) | |
| tree | 5a3588b087e25ac88d1287f050aa98e4bab66f53 /src | |
| parent | 8164b90bc2839d4d2a10c0d2b26c4a413ecf90b2 (diff) | |
timer: constify methods (#12079)
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/time/Timer.cpp | 8 | ||||
| -rw-r--r-- | 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<chr::microseconds>(getDuration()).count() / 1000.F; } -float CTimer::getSeconds() { +float CTimer::getSeconds() const { return chr::duration_cast<chr::milliseconds>(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; +}; |
