code review

This commit is contained in:
Tyler Dixon 2019-05-24 09:48:27 -07:00
parent a02925055c
commit 4e81681ab3
2 changed files with 1 additions and 6 deletions

View File

@ -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 {

View File

@ -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