1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00

Merge pull request #1713 from joshiste/joshiste-precise-create-time

Fix resolution for process create time limited to seconds
This commit is contained in:
shirou 2024-09-26 22:58:15 +09:00 committed by GitHub
commit 7ec134321c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1096,8 +1096,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui
if err != nil {
return 0, 0, nil, 0, 0, 0, nil, err
}
ctime := (t / uint64(clockTicks)) + uint64(bootTime)
createTime := int64(ctime * 1000)
createTime := int64((t * 1000 / uint64(clockTicks)) + uint64(bootTime*1000))
rtpriority, err := strconv.ParseInt(fields[18], 10, 32)
if err != nil {