cpuCurrentSpeed() fix deno workarround

This commit is contained in:
Sebastian Hildebrandt 2025-01-05 08:13:26 +01:00
parent 01e7f401e7
commit 938b192589

View File

@ -1003,9 +1003,9 @@ function getCpuCurrentSpeedSync() {
}
} else if (_linux) {
try {
const speedStrings = execSync('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3', util.execOptsLinux).toString().split('\n');
const speedStrings = execSync('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3', util.execOptsLinux).toString().split('\n').filter((line) => line.length > 0);
for (let i in speedStrings) {
speeds.push(Math.floor(parseInt(speedStrings, 10) / 10) / 100);
speeds.push(Math.floor(parseInt(speedStrings[i], 10) / 10) / 100);
}
} catch {
util.noop();