summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-04-28 19:29:20 +0200
committermonsta <[email protected]>2020-01-09 16:55:55 +0300
commit00940dea8dd26769e964b2ed790a432aba6d93be (patch)
treee7a4a097a0bcf36d7d2c519017599b9de8a57916
parent3dc3e8d36cae303b07235da60e5d2a0149ca4e2d (diff)
downloadmate-system-monitor-00940dea8dd26769e964b2ed790a432aba6d93be.tar.bz2
mate-system-monitor-00940dea8dd26769e964b2ed790a432aba6d93be.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;
}