Skip to content

Commit 1873a1f

Browse files
authoredOct 4, 2017
Merge pull request shirou#431 from Leonid99/whitespace
process.go: reformat whitespaces to keep gofmt happy
2 parents 1ba77cd + 4269f19 commit 1873a1f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
 

‎process/process.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,24 @@ func (p *Process) MemoryPercent() (float32, error) {
199199

200200
return (100 * float32(used) / float32(total)), nil
201201
}
202+
202203
// CPU_Percent returns how many percent of the CPU time this process uses
203204
func (p *Process) CPUPercent() (float64, error) {
204-
crt_time, err := p.CreateTime()
205-
if err != nil {
206-
return 0, err
207-
}
208-
205+
crt_time, err := p.CreateTime()
206+
if err != nil {
207+
return 0, err
208+
}
209209

210-
cput, err := p.Times()
211-
if err != nil {
212-
return 0, err
213-
}
210+
cput, err := p.Times()
211+
if err != nil {
212+
return 0, err
213+
}
214214

215-
created := time.Unix(0, crt_time * int64(time.Millisecond))
216-
totalTime := time.Since(created).Seconds()
217-
if totalTime <= 0 {
218-
return 0, nil
219-
}
215+
created := time.Unix(0, crt_time*int64(time.Millisecond))
216+
totalTime := time.Since(created).Seconds()
217+
if totalTime <= 0 {
218+
return 0, nil
219+
}
220220

221-
return 100 * cput.Total() / totalTime, nil
221+
return 100 * cput.Total() / totalTime, nil
222222
}

0 commit comments

Comments
 (0)
Please sign in to comment.