From a4dccd461cbb36aec5ced04dd86e342edf79a14d Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 30 Dec 2025 09:43:06 +0100 Subject: [PATCH] cpuCurrentSpeed() fix cpu loop issue --- CHANGELOG.md | 1 + docs/history.html | 7 ++++++- docs/index.html | 2 +- lib/cpu.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6149366..27ecbf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.28.5 | 2025-12-30 | `cpuCurrentSpeed()` fix cpu loop issue | | 5.28.4 | 2025-12-29 | `powerShell()` Windows 7 fix compatibility issues (windows) | | 5.28.3 | 2025-12-28 | `processes()`, `processLoad()` fix command line parsing (windows) | | 5.28.2 | 2025-12-27 | `networkConnections()` fix missing PIDs ss command (linux) | diff --git a/docs/history.html b/docs/history.html index 344d410..a4422e6 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,9 +57,14 @@ + + 5.28.5 + 2025-12-30 + cpuCurrentSpeed() fix cpu loop issue + 5.28.4 - 2025-12-28 + 2025-12-30 powerShell() Windows 7 fixed compatibility issues (windows) diff --git a/docs/index.html b/docs/index.html index e2da84f..43d039a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.28.4
+
New Version: 5.28.5
diff --git a/lib/cpu.js b/lib/cpu.js index f46c10d..aa15ad0 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -1238,7 +1238,7 @@ function getCpuCurrentSpeedSync() { const cores = []; const speeds = []; - if (cpus && count.length && Object.prototype.hasOwnProperty.call(cpus[0], 'speed')) { + if (cpus && cpus.length && Object.prototype.hasOwnProperty.call(cpus[0], 'speed')) { for (let i in cpus) { speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10); }