Fixed: Moved up get_cpuHz() in the execution order to get better cpu clock reading.

This commit is contained in:
aristocratos 2022-10-27 15:09:00 +02:00
parent 2247ed3db1
commit 9f0fcdd5bf

View file

@ -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();