aboutsummaryrefslogtreecommitdiff
path: root/zencore/timer.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-04 12:15:21 +0200
committerStefan Boberg <[email protected]>2021-10-04 12:15:21 +0200
commitdc9028c93991011b6d7621aa4a70af1ecf8e2066 (patch)
tree6115805d809a7e0f61816a9af3d6bf63f29be031 /zencore/timer.cpp
parentAdded build version tag using the latest Git commit hash. (#16) (diff)
downloadzen-dc9028c93991011b6d7621aa4a70af1ecf8e2066.tar.xz
zen-dc9028c93991011b6d7621aa4a70af1ecf8e2066.zip
timer: Added GetLofreqTimerValue() etc for applications that don't need particularly high resolution
This value is intended to get updated as part of some higher level tick process. It is not automatic.
Diffstat (limited to 'zencore/timer.cpp')
-rw-r--r--zencore/timer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/zencore/timer.cpp b/zencore/timer.cpp
index 5d30d9b29..9180519bd 100644
--- a/zencore/timer.cpp
+++ b/zencore/timer.cpp
@@ -69,6 +69,22 @@ GetHifreqTimerFrequencySafe()
}
//////////////////////////////////////////////////////////////////////////
+
+uint64_t detail::g_LofreqTimerValue = GetHifreqTimerValue();
+
+void
+UpdateLofreqTimerValue()
+{
+ detail::g_LofreqTimerValue = GetHifreqTimerValue();
+}
+
+uint64_t
+GetLofreqTimerFrequency()
+{
+ return GetHifreqTimerFrequencySafe();
+}
+
+//////////////////////////////////////////////////////////////////////////
//
// Testing related code follows...
//