diff options
| author | Stefan Boberg <[email protected]> | 2021-10-11 13:17:39 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-11 13:17:39 +0200 |
| commit | 63d168012088be6dc578298fbc9b163fbf38e150 (patch) | |
| tree | 8088c8c427c4aaa0f25071fd46f17702e758bf7d | |
| parent | iobuffer: Changed MakeFromTemporaryFile so it accepts a path instead of a cha... (diff) | |
| download | zen-63d168012088be6dc578298fbc9b163fbf38e150.tar.xz zen-63d168012088be6dc578298fbc9b163fbf38e150.zip | |
Added lofreq timer update to httpsys main loop
| -rw-r--r-- | zencore/timer.cpp | 8 | ||||
| -rw-r--r-- | zenhttp/httpsys.cpp | 2 |
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()); } |