clarify return value of cpu.Percent()

This commit is contained in:
Jakob Gillich 2017-03-31 16:07:44 +02:00 committed by GitHub
parent f18f7dcbae
commit facb241c12
1 changed files with 3 additions and 2 deletions

View File

@ -132,6 +132,7 @@ func calculateAllBusy(t1, t2 []TimesStat) ([]float64, error) {
// Percent calculates the percentage of cpu used either per CPU or combined. // 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. // 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) { func Percent(interval time.Duration, percpu bool) ([]float64, error) {
if interval <= 0 { if interval <= 0 {
return percentUsedFromLastCall(percpu) return percentUsedFromLastCall(percpu)