aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/timer.cpp7
-rw-r--r--src/utils/timer.hpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp
index 966178b..1461ac4 100644
--- a/src/utils/timer.cpp
+++ b/src/utils/timer.cpp
@@ -71,3 +71,10 @@ bool frequency_clock_t::elapsed(bool stagger)
return frequency_ == 0 || elapsed_time >= period;
}
+
+/// @brief Force the clock to tick, regardless of it its time has actually
+/// elapsed.
+void frequency_clock_t::tick()
+{
+ last_tick_ = get_time_function()();
+} \ No newline at end of file
diff --git a/src/utils/timer.hpp b/src/utils/timer.hpp
index 8037b85..ce6336e 100644
--- a/src/utils/timer.hpp
+++ b/src/utils/timer.hpp
@@ -56,4 +56,6 @@ public:
bool started();
time_function_t get_time_function();
bool elapsed(bool stagger);
+
+ void tick();
}; \ No newline at end of file