cpu() Apple Silicon M1 frequency

This commit is contained in:
Sebastian Hildebrandt 2020-12-17 22:49:39 +01:00
parent 5654ab94b9
commit 57d23559ed

View File

@ -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;