diff --git a/src/cpu.cpp b/src/cpu.cpp index 69600eb..09e2c59 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -35,6 +35,7 @@ void update(cpuSensors* c) { c->tctl = std::stoi(readFile(c->hwmon + "/temp1_input", 2)); c->tccd1 = std::stoi(readFile(c->hwmon + "/temp3_input", 2)); // read power from intel-rapl? works on amd too, btop uses this trick, seems accurate + // it tracks with "socket power" in hwinfo on windows, its actually the same thing i had in lcdsmartie auto current_ts = std::chrono::steady_clock::now(); auto current_usage = std::stoul(readFile("/sys/class/powercap/intel-rapl:0/energy_uj", 24)); c->ptotal = (float)(current_usage - previous_usage) / (float)(std::chrono::duration_cast(current_ts - previous_ts).count());