MCPcopy
hub / github.com/bnb-chain/bsc / Time

Method Time

metrics/timer.go:222–226  ·  view source on GitHub ↗

Record the duration of the execution of the given function.

(f func())

Source from the content-addressed store, hash-verified

220
221// Record the duration of the execution of the given function.
222func (t *StandardTimer) Time(f func()) {
223 ts := time.Now()
224 f()
225 t.Update(time.Since(ts))
226}
227
228// Record the duration of an event, in nanoseconds.
229func (t *StandardTimer) Update(d time.Duration) {

Callers

nothing calls this directly

Calls 3

UpdateMethod · 0.95
NowMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected