cpuCurrentSpeed() fix cpu loop issue

This commit is contained in:
Sebastian Hildebrandt 2025-12-30 09:43:06 +01:00
parent ff7137d794
commit a4dccd461c
4 changed files with 9 additions and 3 deletions

View File

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

View File

@ -57,9 +57,14 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.28.5</th>
<td>2025-12-30</td>
<td><span class="code">cpuCurrentSpeed()</span> fix cpu loop issue</td>
</tr>
<tr>
<th scope="row">5.28.4</th>
<td>2025-12-28</td>
<td>2025-12-30</td>
<td><span class="code">powerShell()</span> Windows 7 fixed compatibility issues (windows)</td>
</tr>
<tr>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.28.4</span></div>
<div class="version">New Version: <span id="version">5.28.5</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

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