From bb8ef1d9e2373f80183f7612bb6c4f825fdcebe6 Mon Sep 17 00:00:00 2001 From: Laz Date: Sun, 19 Nov 2023 11:43:21 +0000 Subject: [PATCH] fix: fix perf timer logs being garbage --- FLHookSDK | 2 +- include/API/Utils/PerfTimer.hpp | 2 +- source/Utils/PerfTimer.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/FLHookSDK b/FLHookSDK index c3e9a7925..334aa4f84 160000 --- a/FLHookSDK +++ b/FLHookSDK @@ -1 +1 @@ -Subproject commit c3e9a79254df6f6cbe989c70f5510de8481d7e37 +Subproject commit 334aa4f840374a93cb8021a98941dbe7af94b67a diff --git a/include/API/Utils/PerfTimer.hpp b/include/API/Utils/PerfTimer.hpp index b082dd7ec..6c9f04135 100644 --- a/include/API/Utils/PerfTimer.hpp +++ b/include/API/Utils/PerfTimer.hpp @@ -10,6 +10,6 @@ class DLL PerfTimer private: mstime tmStart = 0; ulong max = 0; - std::wstring_view function; + std::wstring function; ulong warning; }; diff --git a/source/Utils/PerfTimer.cpp b/source/Utils/PerfTimer.cpp index 9f6bf0a76..1745cb82a 100644 --- a/source/Utils/PerfTimer.cpp +++ b/source/Utils/PerfTimer.cpp @@ -1,4 +1,4 @@ -#include "PCH.hpp" +#include "PCH.hpp" #include "API/Utils/PerfTimer.hpp" @@ -14,12 +14,13 @@ ulong PerfTimer::Stop() { if (timeDelta > max && timeDelta > warning) { - Logger::Log(LogLevel::Info, std::format(L"Spent {} ms in {}, longest so far.", timeDelta, function)); + auto str = std::format(L"Spent {} μs in {}, longest so far.", timeDelta, function); + Logger::Log(LogLevel::Info, std::format(L"Spent {} μs in {}, longest so far.", timeDelta, function)); max = timeDelta; } else if (timeDelta > 100) { - Logger::Log(LogLevel::Info, std::format(L"Spent {} ms in {}", timeDelta, function)); + Logger::Log(LogLevel::Info, std::format(L"Spent {} μs in {}", timeDelta, function)); } } return timeDelta;