From 33c46b39fec4b5833d1dcc0134b644cb57c4a60c Mon Sep 17 00:00:00 2001 From: Zhao Huijun Date: Wed, 17 May 2023 14:21:52 +0800 Subject: [PATCH] fix: ticks2ns m_cpuFrequency is per millisecond in #else. --- easy_profiler_core/profile_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy_profiler_core/profile_manager.cpp b/easy_profiler_core/profile_manager.cpp index de70404..12fe96d 100644 --- a/easy_profiler_core/profile_manager.cpp +++ b/easy_profiler_core/profile_manager.cpp @@ -1300,7 +1300,7 @@ profiler::timestamp_t ProfileManager::ticks2us(profiler::timestamp_t ticks) cons #else profiler::timestamp_t ProfileManager::ticks2ns(profiler::timestamp_t ticks) const { - return static_cast(ticks / m_cpuFrequency.load(std::memory_order_acquire)); + return static_cast(ticks * 1000000LL / m_cpuFrequency.load(std::memory_order_acquire)); } profiler::timestamp_t ProfileManager::ticks2us(profiler::timestamp_t ticks) const