diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-04-16 01:37:48 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-04-16 01:37:48 +0100 |
| commit | 877fb5b93ada9b25b4d2f5ca5f69370fa345f1ac (patch) | |
| tree | 5b52ad19c695590ae50c7adae06b8e3aeccf34c1 /src/helpers/Timer.cpp | |
| parent | 0e521788bcc414c9cf81648d3167757d83deb60f (diff) | |
time: move to stl's clocks and move timer
Diffstat (limited to 'src/helpers/Timer.cpp')
| -rw-r--r-- | src/helpers/Timer.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/helpers/Timer.cpp b/src/helpers/Timer.cpp deleted file mode 100644 index e00c5918..00000000 --- a/src/helpers/Timer.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "Timer.hpp" -#include <chrono> - -void CTimer::reset() { - m_tpLastReset = std::chrono::steady_clock::now(); -} - -std::chrono::steady_clock::duration CTimer::getDuration() { - return std::chrono::steady_clock::now() - m_tpLastReset; -} - -float CTimer::getMillis() { - return std::chrono::duration_cast<std::chrono::microseconds>(getDuration()).count() / 1000.f; -} - -float CTimer::getSeconds() { - return std::chrono::duration_cast<std::chrono::milliseconds>(getDuration()).count() / 1000.f; -} - -const std::chrono::steady_clock::time_point& CTimer::chrono() const { - return m_tpLastReset; -}
\ No newline at end of file |
