Skip to content

Commit

Permalink
metrics: NilTimer should still run the function to be timed (#27723)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Jul 14, 2023
1 parent 60ecf48 commit 13c0305
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/timer.go
Expand Up @@ -123,7 +123,7 @@ func (NilTimer) Stop() {}
func (NilTimer) Sum() int64 { return 0 }

// Time is a no-op.
func (NilTimer) Time(func()) {}
func (NilTimer) Time(f func()) { f() }

// Update is a no-op.
func (NilTimer) Update(time.Duration) {}
Expand Down

0 comments on commit 13c0305

Please sign in to comment.