MCPcopy Create free account
hub / github.com/prometheus/procfs / StartTime

Method StartTime

proc_stat.go:224–230  ·  view source on GitHub ↗

StartTime returns the unix timestamp of the process in seconds.

()

Source from the content-addressed store, hash-verified

222
223// StartTime returns the unix timestamp of the process in seconds.
224func (s ProcStat) StartTime() (float64, error) {
225 stat, err := s.proc.Stat()
226 if err != nil {
227 return 0, err
228 }
229 return float64(stat.BootTime) + (float64(s.Starttime) / userHZ), nil
230}
231
232// CPUTime returns the total CPU user and system time in seconds.
233func (s ProcStat) CPUTime() float64 {

Callers 1

TestProcStatStartTimeFunction · 0.80

Calls 1

StatMethod · 0.45

Tested by 1

TestProcStatStartTimeFunction · 0.64