diff --git a/include/Client.h b/include/Client.h index 97e3bd7..6b50a7b 100644 --- a/include/Client.h +++ b/include/Client.h @@ -101,7 +101,7 @@ public: // bytes sent on TCP std::atomic_size_t TcpSent = 0; - std::chrono::high_resolution_clock::time_point ConnectionTime{}; + std::chrono::system_clock::time_point ConnectionTime{}; private: diff --git a/include/TScopedTimer.h b/include/TScopedTimer.h index 600e69a..0f1ad85 100644 --- a/include/TScopedTimer.h +++ b/include/TScopedTimer.h @@ -11,7 +11,7 @@ public: TScopedTimer(std::function OnDestroy); ~TScopedTimer(); auto GetElapsedTime() const { - auto EndTime = std::chrono::high_resolution_clock::now(); + auto EndTime = std::chrono::system_clock::now(); auto Delta = EndTime - mStartTime; size_t TimeDelta = Delta / std::chrono::milliseconds(1); return TimeDelta; @@ -20,6 +20,6 @@ public: std::function OnDestroy { nullptr }; private: - std::chrono::high_resolution_clock::time_point mStartTime; + std::chrono::system_clock::time_point mStartTime; std::string Name; }; diff --git a/src/TConsole.cpp b/src/TConsole.cpp index 4cd7b1e..21eca40 100644 --- a/src/TConsole.cpp +++ b/src/TConsole.cpp @@ -323,7 +323,7 @@ void TConsole::Command_Debug(const std::string&, const std::vector& } State += "Disconnected"; } - auto Now = std::chrono::high_resolution_clock::now(); + auto Now = std::chrono::system_clock::now(); auto Seconds = std::chrono::duration_cast(Now - Locked->ConnectionTime); std::string ConnectedSince = fmt::format("{:%Y/%m/%d %H:%M:%S}, {:%H:%M:%S} ago ({} seconds)", fmt::localtime(std::chrono::system_clock::to_time_t(Locked->ConnectionTime)), diff --git a/src/TScopedTimer.cpp b/src/TScopedTimer.cpp index 9e15056..f8cd297 100644 --- a/src/TScopedTimer.cpp +++ b/src/TScopedTimer.cpp @@ -2,21 +2,21 @@ #include "Common.h" TScopedTimer::TScopedTimer() - : mStartTime(std::chrono::high_resolution_clock::now()) { + : mStartTime(std::chrono::system_clock::now()) { } TScopedTimer::TScopedTimer(const std::string& mName) - : mStartTime(std::chrono::high_resolution_clock::now()) + : mStartTime(std::chrono::system_clock::now()) , Name(mName) { } TScopedTimer::TScopedTimer(std::function OnDestroy) : OnDestroy(OnDestroy) - , mStartTime(std::chrono::high_resolution_clock::now()) { + , mStartTime(std::chrono::system_clock::now()) { } TScopedTimer::~TScopedTimer() { - auto EndTime = std::chrono::high_resolution_clock::now(); + auto EndTime = std::chrono::system_clock::now(); auto Delta = EndTime - mStartTime; size_t TimeDelta = Delta / std::chrono::milliseconds(1); if (OnDestroy) {