From 9f0fcdd5bf9d87d0579a8363f4b9bf570e669f07 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Thu, 27 Oct 2022 15:09:00 +0200 Subject: [PATCH] Fixed: Moved up get_cpuHz() in the execution order to get better cpu clock reading. --- src/linux/btop_collect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index f57b6e5..7bc1f93 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -667,6 +667,9 @@ namespace Cpu { if (Runner::stopping or (no_update and not current_cpu.cpu_percent.at("total").empty())) return current_cpu; auto& cpu = current_cpu; + if (Config::getB("show_cpu_freq")) + cpuHz = get_cpuHz(); + ifstream cread; try { @@ -794,9 +797,6 @@ namespace Cpu { else throw std::runtime_error("Cpu::collect() : " + string{e.what()}); } - if (Config::getB("show_cpu_freq")) - cpuHz = get_cpuHz(); - if (Config::getB("check_temp") and got_sensors) update_sensors();