diff --git a/widgets/cpu.go b/widgets/cpu.go index 4e226c0..b84af2c 100644 --- a/widgets/cpu.go +++ b/widgets/cpu.go @@ -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 {