Revision 57cea206
Added by Steve Beaver almost 8 years ago
src/usr/local/www/widgets/widgets/system_information.widget.php | ||
---|---|---|
568 | 568 |
} |
569 | 569 |
|
570 | 570 |
function updateCPU(total, used) { |
571 |
|
|
572 |
// Just in case it wraps |
|
573 |
if ((lastTotal <= total) && (lastUsed <= used)) { |
|
571 |
if ((lastTotal <= total) && (lastUsed <= used)) { // Just in case it wraps |
|
574 | 572 |
// Calculate the total ticks and the used ticks sine the last time it was checked |
575 | 573 |
var d_total = total - lastTotal; |
576 | 574 |
var d_used = used - lastUsed; |
... | ... | |
592 | 590 |
} |
593 | 591 |
} |
594 | 592 |
|
593 |
// Update the saved "last" values |
|
595 | 594 |
lastTotal = total; |
596 | 595 |
lastUsed = used; |
597 | 596 |
} |
Also available in: Unified diff
Widget comment edit