summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-04-28 19:29:20 +0200
committerlukefromdc <[email protected]>2019-05-03 04:17:30 +0000
commit74723c1a5f4275af448bd3879cd882c8c64ad744 (patch)
treef8b2ef29259d4acbf9f3d4e8b690da5305572115
parentc09e5228537e4bcf5c9a074c696b698ff8ead1a5 (diff)
downloadmate-system-monitor-74723c1a5f4275af448bd3879cd882c8c64ad744.tar.bz2
mate-system-monitor-74723c1a5f4275af448bd3879cd882c8c64ad744.tar.xz
smooth_refresh: Assigned value is garbage or undefined
-rw-r--r--src/smooth_refresh.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/smooth_refresh.cpp b/src/smooth_refresh.cpp
index 8f6307c..2702851 100644
--- a/src/smooth_refresh.cpp
+++ b/src/smooth_refresh.cpp
@@ -31,12 +31,12 @@ unsigned SmoothRefresh::get_own_cpu_usage()
if (elapsed) { // avoid division by 0
glibtop_get_proc_time(&proctime, getpid());
usage = (proctime.rtime - this->last_cpu_time) * 100 / elapsed;
+ this->last_cpu_time = proctime.rtime;
}
usage = CLAMP(usage, 0, 100);
this->last_total_time = cpu.total;
- this->last_cpu_time = proctime.rtime;
return usage;
}