From 01e7f401e7c4e7bdd0a69cb15ff06f258433647b Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sun, 5 Jan 2025 08:02:12 +0100 Subject: [PATCH] cpuCurrentSpeed() fix deno workarround --- lib/cpu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cpu.js b/lib/cpu.js index a7942d8..42a2168 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -1003,9 +1003,9 @@ function getCpuCurrentSpeedSync() { } } else if (_linux) { try { - 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'); for (let i in speedStrings) { - speeds.push(parseInt(speedStrings, 10)); + speeds.push(Math.floor(parseInt(speedStrings, 10) / 10) / 100); } } catch { util.noop();