fmt
This commit is contained in:
parent
c2ea7d14a0
commit
9a0ae2ae8b
@ -16,12 +16,12 @@ func main() {
|
|||||||
|
|
||||||
p, _ := process.NewProcess(int32(*flagPID))
|
p, _ := process.NewProcess(int32(*flagPID))
|
||||||
v, err := p.Times()
|
v, err := p.Times()
|
||||||
cnt:=0
|
cnt := 0
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if *flagNUM >= 0 && cnt >= *flagNUM {
|
if *flagNUM >= 0 && cnt >= *flagNUM {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Printf("%d pid: %d user: %f\t system: %f\n", time.Now().Unix(), *flagPID, v.User, v.System)
|
fmt.Printf("%d pid: %d user: %f\t system: %f\n", time.Now().Unix(), *flagPID, v.User, v.System)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user