From 74723c1a5f4275af448bd3879cd882c8c64ad744 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 28 Apr 2019 19:29:20 +0200 Subject: smooth_refresh: Assigned value is garbage or undefined --- src/smooth_refresh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/smooth_refresh.cpp') 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; } -- cgit v1.2.1