Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
CPU widget code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbassi committed Apr 11, 2018
1 parent 9f22c32 commit 08e9812
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widgets/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ func NewCPU(interval time.Duration, zoom int) *CPU {
return self
}

// calculates the CPU usage over a 1 second interval and blocks for the duration
func (self *CPU) update() {
// psutil calculates the CPU usage over a 1 second interval, therefore it blocks for 1 second
// show average cpu usage if more than 8 cores
if self.Count <= 8 {
percents, _ := psCPU.Percent(self.interval, true)
if len(percents) != self.Count {
Expand Down

0 comments on commit 08e9812

Please sign in to comment.