diff --git a/process/process.go b/process/process.go index 1a7fe1b80..ed6ee0f18 100644 --- a/process/process.go +++ b/process/process.go @@ -341,12 +341,7 @@ func (p *Process) CPUPercent() (float64, error) { } func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { - crt_time, err := p.createTimeWithContext(ctx) - if err != nil { - return 0, err - } - - cput, err := p.TimesWithContext(ctx) + _, _, cput, crt_time, _, _, _, err := p.fillFromStatWithContext(ctx) if err != nil { return 0, err }