0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 00:31:02 +08:00

fix: ticks2ns

m_cpuFrequency is per millisecond in #else.
This commit is contained in:
Zhao Huijun 2023-05-17 14:21:52 +08:00 committed by GitHub
parent 3104dd4ae7
commit 33c46b39fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1300,7 +1300,7 @@ profiler::timestamp_t ProfileManager::ticks2us(profiler::timestamp_t ticks) cons
#else #else
profiler::timestamp_t ProfileManager::ticks2ns(profiler::timestamp_t ticks) const profiler::timestamp_t ProfileManager::ticks2ns(profiler::timestamp_t ticks) const
{ {
return static_cast<profiler::timestamp_t>(ticks / m_cpuFrequency.load(std::memory_order_acquire)); return static_cast<profiler::timestamp_t>(ticks * 1000000LL / m_cpuFrequency.load(std::memory_order_acquire));
} }
profiler::timestamp_t ProfileManager::ticks2us(profiler::timestamp_t ticks) const profiler::timestamp_t ProfileManager::ticks2us(profiler::timestamp_t ticks) const