Author: akhaldi
Date: Mon Mar 9 17:38:31 2015
New Revision: 66621
URL:
http://svn.reactos.org/svn/reactos?rev=66621&view=rev
Log:
[TASKMGR] Do not show negative CPU usage. By Peter Hater. CORE-9050
Modified:
trunk/reactos/base/applications/taskmgr/perfdata.c
Modified: trunk/reactos/base/applications/taskmgr/perfdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] Mon Mar 9 17:38:31
2015
@@ -298,6 +298,12 @@
/* CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors */
dbIdleTime = 100.0 - dbIdleTime * 100.0 /
(double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */
dbKernelTime = 100.0 - dbKernelTime * 100.0 /
(double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */
+
+ if (dbIdleTime < 0.0) dbIdleTime = 0.0;
+ if (dbIdleTime > 100.0) dbIdleTime = 100.0;
+ if (dbKernelTime < 0.0) dbKernelTime = 0.0;
+ if (dbKernelTime > 100.0) dbKernelTime = 100.0;
+
}
/* Store new CPU's idle and system time */