From 1e736478ee40da91ba57be12119c63cfb560232a Mon Sep 17 00:00:00 2001 From: EricPlayZ Date: Wed, 5 Jul 2023 03:21:11 +0300 Subject: [PATCH] moved timestamp function to time_tools.h --- DL2FOVOverhaul/source/core.cpp | 12 ------------ DL2FOVOverhaul/source/time_tools.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DL2FOVOverhaul/source/core.cpp b/DL2FOVOverhaul/source/core.cpp index 374ae50..2212df4 100644 --- a/DL2FOVOverhaul/source/core.cpp +++ b/DL2FOVOverhaul/source/core.cpp @@ -11,18 +11,6 @@ #include "time_tools.h" #include "SigScan\StaticOffsets.h" -static std::ostringstream GetTimestamp() { - time_t timeInstance = time(0); - tm timestamp{}; - localtime_s(×tamp, &timeInstance); - std::ostringstream oss{}; - oss << "[" << std::setw(2) << std::setfill('0') << timestamp.tm_hour << "h:" - << std::setw(2) << std::setfill('0') << timestamp.tm_min << "m:" - << std::setw(2) << std::setfill('0') << timestamp.tm_sec << "s] "; - - return oss; -} - CLobbySteam* CLobbySteamInstance = NULL; CGame* CGameInstance = NULL; PlayerVariables* PlayerVariablesInstance = NULL; diff --git a/DL2FOVOverhaul/source/time_tools.h b/DL2FOVOverhaul/source/time_tools.h index ce41b6c..b55ffcf 100644 --- a/DL2FOVOverhaul/source/time_tools.h +++ b/DL2FOVOverhaul/source/time_tools.h @@ -3,4 +3,16 @@ template auto since(std::chrono::time_point const& start) { return std::chrono::duration_cast(clock_t::now() - start); +} + +inline std::ostringstream GetTimestamp() { + time_t timeInstance = time(0); + tm timestamp{}; + localtime_s(×tamp, &timeInstance); + std::ostringstream oss{}; + oss << "[" << std::setw(2) << std::setfill('0') << timestamp.tm_hour << "h:" + << std::setw(2) << std::setfill('0') << timestamp.tm_min << "m:" + << std::setw(2) << std::setfill('0') << timestamp.tm_sec << "s] "; + + return oss; } \ No newline at end of file