summaryrefslogtreecommitdiffstats
path: root/CPUMeter.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-09-09 19:38:53 +1000
committerNathan Scott <nathans@redhat.com>2020-09-09 19:38:53 +1000
commit4d6e4ef53c070e2b9f1d3bae686d4deb7c266a5b (patch)
treebbab1d988ad98f7aee278db09bb0397d3683b05f /CPUMeter.c
parent459733295954ec0d5958f9a8d955d0c164876c84 (diff)
parentd0e8ff9319cb9c0c283234bdaa16d4753672e1e7 (diff)
Merge branch 'master' of https://github.com/rgouicem/htop into rgouicem-master
Diffstat (limited to 'CPUMeter.c')
-rw-r--r--CPUMeter.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/CPUMeter.c b/CPUMeter.c
index df5585e9..cb77e712 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -40,18 +40,12 @@ static void CPUMeter_updateValues(Meter* this, char* buffer, int size) {
memset(this->values, 0, sizeof(double) * CPU_METER_ITEMCOUNT);
double percent = Platform_setCPUValues(this, cpu);
if (this->pl->settings->showCPUFrequency) {
- /* Initial frequency is in MHz. Emit it as GHz if it's larger than 1000MHz */
double cpuFrequency = this->values[CPU_METER_FREQUENCY];
- char unit = 'M';
char cpuFrequencyBuffer[16];
if (cpuFrequency < 0) {
xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "N/A");
} else {
- if (cpuFrequency > 1000) {
- cpuFrequency /= 1000;
- unit = 'G';
- }
- xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%.3f%cHz", cpuFrequency, unit);
+ xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%.0fMHz", cpuFrequency);
}
if (this->pl->settings->showCPUUsage) {
xSnprintf(buffer, size, "%5.1f%% %s", percent, cpuFrequencyBuffer);

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