Skip to content

Commit

Permalink
chore: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Apr 15, 2022
1 parent a939bc3 commit bf845b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/* typescript
* export declare const container: {
* cpuNum(): number;
* cpuUsage(period?: number): number;
* cpuLoad(period?: number): number;
* };
*/
Expand Down Expand Up @@ -100,8 +101,8 @@ function realCpuLoads(cpus, period = 0) {
}

function calculateCpuLoad(lastCpu, cpu) {
lastTimes = lastCpu.times;
times = cpu.times;
const lastTimes = lastCpu.times;
const times = cpu.times;
const lastLoad =
lastTimes.user + lastTimes.sys + lastTimes.nice + lastTimes.irq;
const lastTick = lastLoad + lastTimes.idle;
Expand Down

0 comments on commit bf845b1

Please sign in to comment.