code review
This commit is contained in:
parent
a02925055c
commit
4e81681ab3
|
@ -49,11 +49,6 @@ func NumProcs() (uint64, error) {
|
|||
// cachedBootTime must be accessed via atomic.Load/StoreUint64
|
||||
var cachedBootTime uint64
|
||||
|
||||
// BootTime returns the system boot time expressed in seconds since the epoch.
|
||||
func BootTime() (uint64, error) {
|
||||
return BootTimeWithContext(context.Background())
|
||||
}
|
||||
|
||||
func BootTimeWithContext(ctx context.Context) (uint64, error) {
|
||||
t := atomic.LoadUint64(&cachedBootTime)
|
||||
if t != 0 {
|
||||
|
|
|
@ -1235,7 +1235,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui
|
|||
System: float64(stime / ClockTicks),
|
||||
}
|
||||
|
||||
bootTime, _ := common.BootTime()
|
||||
bootTime, _ := common.BootTimeWithContext(ctx)
|
||||
t, err := strconv.ParseUint(fields[i+20], 10, 64)
|
||||
if err != nil {
|
||||
return 0, 0, nil, 0, 0, 0, nil, err
|
||||
|
|
Loading…
Reference in New Issue