mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 00:03:22 +00:00
[TASKMGR] Do not show negative CPU usage. By Peter Hater. CORE-9050
svn path=/trunk/; revision=66621
This commit is contained in:
parent
780865a796
commit
220e1cfae1
1 changed files with 6 additions and 0 deletions
|
@ -298,6 +298,12 @@ void PerfDataRefresh(void)
|
|||
/* 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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue