We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 532bec9 commit 8a5eec0Copy full SHA for 8a5eec0
src/linux/btop_collect.cpp
@@ -994,6 +994,12 @@ namespace Cpu {
994
auto current_timestamp = get_monotonicTimeUSec();
995
auto current_usage = get_cpuConsumptionUJoules();
996
997
+ int i = 0;
998
+ while (current_usage < previous_usage and ++i <= 4) {
999
+ current_timestamp = get_monotonicTimeUSec();
1000
+ current_usage = get_cpuConsumptionUJoules();
1001
+ }
1002
+
1003
auto watts = (float)(current_usage - previous_usage) / (float)(current_timestamp - previous_timestamp);
1004
1005
previous_timestamp = current_timestamp;
0 commit comments