summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-03-04 12:09:24 +0100
committerBenBE <BenBE@geshi.org>2023-03-04 12:41:16 +0100
commite207c8aebdcdb88bc8ab838e2ac3dd1774d6a618 (patch)
tree4bd6629235c9e849385736d750383b117fc4ebcf /openbsd
parentc803ec6dae5556fa35d6bd8124aa536633887f77 (diff)
Improve CPU computation code
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/Platform.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 615397e2..e49a0f81 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -205,13 +205,12 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) {
v[CPU_METER_IOWAIT] = 0.0;
v[CPU_METER_FREQUENCY] = NAN;
this->curItems = 8;
- totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL] + v[CPU_METER_IRQ];
} else {
v[CPU_METER_KERNEL] = cpuData->sysAllPeriod / total * 100.0;
v[CPU_METER_IRQ] = 0.0; // No steal nor guest on OpenBSD
- totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL];
this->curItems = 4;
}
+ totalPercent = v[CPU_METER_NICE] + v[CPU_METER_NORMAL] + v[CPU_METER_KERNEL] + v[CPU_METER_IRQ];
totalPercent = CLAMP(totalPercent, 0.0, 100.0);

© 2014-2024 Faster IT GmbH | imprint | privacy policy