aboutsummaryrefslogtreecommitdiff
path: root/zencore/timer.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-11 13:17:39 +0200
committerStefan Boberg <[email protected]>2021-10-11 13:17:39 +0200
commit63d168012088be6dc578298fbc9b163fbf38e150 (patch)
tree8088c8c427c4aaa0f25071fd46f17702e758bf7d /zencore/timer.cpp
parentiobuffer: Changed MakeFromTemporaryFile so it accepts a path instead of a cha... (diff)
downloadzen-63d168012088be6dc578298fbc9b163fbf38e150.tar.xz
zen-63d168012088be6dc578298fbc9b163fbf38e150.zip
Added lofreq timer update to httpsys main loop
Diffstat (limited to 'zencore/timer.cpp')
-rw-r--r--zencore/timer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/zencore/timer.cpp b/zencore/timer.cpp
index 9180519bd..1655e912d 100644
--- a/zencore/timer.cpp
+++ b/zencore/timer.cpp
@@ -17,16 +17,20 @@ namespace zen {
uint64_t
GetHifreqTimerValue()
{
+ uint64_t Timestamp;
+
#if ZEN_PLATFORM_WINDOWS
LARGE_INTEGER li;
QueryPerformanceCounter(&li);
- return li.QuadPart;
+ Timestamp = li.QuadPart;
#else
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- return (uint64_t(ts.tv_sec) * 1000000ull) + (uint64_t(ts.tv_nsec) / 1000ull);
+ Timestamp = (uint64_t(ts.tv_sec) * 1000000ull) + (uint64_t(ts.tv_nsec) / 1000ull);
#endif
+
+ return Timestamp;
}
uint64_t