From facb241c128e90a950b9e4c132c4247ee40278a2 Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Fri, 31 Mar 2017 16:07:44 +0200 Subject: [PATCH] clarify return value of cpu.Percent() --- cpu/cpu.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpu/cpu.go b/cpu/cpu.go index 2bd5c8d4..f5bf315f 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -130,8 +130,9 @@ func calculateAllBusy(t1, t2 []TimesStat) ([]float64, error) { return ret, nil } -//Percent calculates the percentage of cpu used either per CPU or combined. -//If an interval of 0 is given it will compare the current cpu times against the last call. +// Percent calculates the percentage of cpu used either per CPU or combined. +// If an interval of 0 is given it will compare the current cpu times against the last call. +// Returns one value per cpu, or a single value if percpu is set to false. func Percent(interval time.Duration, percpu bool) ([]float64, error) { if interval <= 0 { return percentUsedFromLastCall(percpu)