mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
feat: tweak a bit
This commit is contained in:
parent
e331197ccd
commit
b6769a61a8
1 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ func (t *StandardTimer) Time(f func()) {
|
||||||
t.Update(time.Since(ts))
|
t.Update(time.Since(ts))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update record the duration of an event, in nanoseconds.
|
// Update the duration of an event, in nanoseconds.
|
||||||
func (t *StandardTimer) Update(d time.Duration) {
|
func (t *StandardTimer) Update(d time.Duration) {
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
defer t.mutex.Unlock()
|
defer t.mutex.Unlock()
|
||||||
|
|
@ -114,7 +114,7 @@ func (t *StandardTimer) Update(d time.Duration) {
|
||||||
t.meter.Mark(1)
|
t.meter.Mark(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSince record the duration of an event that started at a time and ends now.
|
// UpdateSince update the duration of an event that started at a time and ends now.
|
||||||
// The record uses nanoseconds.
|
// The record uses nanoseconds.
|
||||||
func (t *StandardTimer) UpdateSince(ts time.Time) {
|
func (t *StandardTimer) UpdateSince(ts time.Time) {
|
||||||
t.Update(time.Since(ts))
|
t.Update(time.Since(ts))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue