Skip to content

Commit

Permalink
FreeBSD: Add StartTime for ProcTime
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Jan 24, 2023
1 parent a2213c4 commit 77c6605
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sigar_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ func (self *ProcTime) Get(pid int) error {
self.User = uint64(rusage.Utime.Nano() / 1e6)
self.Sys = uint64(rusage.Stime.Nano() / 1e6)
self.Total = self.User + self.Sys

var tv unix.Timeval
pinfo, err := getProcInfo(pid)
if err != nil {
return err
}
tv = *(*unix.Timeval)(unsafe.Pointer(&pinfo.Start[0]))
self.StartTime = (uint64(tv.Sec) * 1000) + (uint64(tv.Usec) / 1000)

return nil
}

Expand Down

0 comments on commit 77c6605

Please sign in to comment.