[linux] Process.CreateTime was returned msec, not sec.

pull/52/head
Shirou WAKAYAMA 10 years ago
parent 3bd9ace228
commit 0921e1f153

@ -560,8 +560,7 @@ func (p *Process) fillFromStat() (string, int32, *cpu.CPUTimesStat, int64, int32
if err != nil {
return "", 0, nil, 0, 0, err
}
ctime := ((t / uint64(ClockTicks)) + uint64(bootTime)) * 1000
ctime := (t / uint64(ClockTicks)) + uint64(bootTime)
createTime := int64(ctime)
// p.Nice = mustParseInt32(fields[18])

@ -239,3 +239,15 @@ func Test_Process_CpuPercentLoop(t *testing.T) {
}
}
}
func Test_Process_CreateTime(t *testing.T) {
p := testGetProcess()
c, err := p.CreateTime()
if err != nil {
t.Errorf("error %v", err)
}
if c < 1420000000 {
t.Errorf("process created time is wrong.")
}
}

Loading…
Cancel
Save