From 57d23559eddd8326a2e42e84b743a330aeef825c Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 17 Dec 2020 22:49:39 +0100 Subject: [PATCH] cpu() Apple Silicon M1 frequency --- lib/cpu.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cpu.js b/lib/cpu.js index 0728322..bf296d3 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -726,8 +726,7 @@ function getCpuCurrentSpeedSync() { if (cpus && cpus.length) { for (let i in cpus) { if ({}.hasOwnProperty.call(cpus, i)) { - let freq = (cpus[i].speed + 1) / 1000; - freq = freq < 0.1 ? freq * 100 : freq; + let freq = cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10; avgFreq = avgFreq + freq; if (freq > maxFreq) maxFreq = freq; if (freq < minFreq) minFreq = freq;