Skip to content

Commit

Permalink
fix:use time.Since instead of time.Now().Sub
Browse files Browse the repository at this point in the history
  • Loading branch information
gongna-au committed Oct 5, 2023
1 parent 0f0100f commit 0f2cab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/metrics/stats/timings.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (t *Timings) Add(name string, elapsed time.Duration) {
// Record is a convenience function that records completion
// timing data based on the provided start time of an event.
func (t *Timings) Record(name string, startTime time.Time) {
t.Add(name, time.Now().Sub(startTime))
t.Add(name, time.Since(startTime))
}

// String is for expvar.
Expand Down

0 comments on commit 0f2cab0

Please sign in to comment.