aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--zencore/timer.cpp8
-rw-r--r--zenhttp/httpsys.cpp2
2 files changed, 8 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
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp
index f88563097..f550f1f4c 100644
--- a/zenhttp/httpsys.cpp
+++ b/zenhttp/httpsys.cpp
@@ -9,6 +9,7 @@
#include <zencore/logging.h>
#include <zencore/scopeguard.h>
#include <zencore/string.h>
+#include <zencore/timer.h>
#include <zenhttp/httpshared.h>
#if ZEN_WITH_HTTPSYS
@@ -878,6 +879,7 @@ HttpSysServer::Run(bool IsInteractive)
}
m_ShutdownEvent.Wait(WaitTimeout);
+ UpdateLofreqTimerValue();
} while (!IsApplicationExitRequested());
}