MCPcopy
hub / github.com/kopia/kopia / NowFunc

Method NowFunc

internal/faketime/faketime.go:81–88  ·  view source on GitHub ↗

NowFunc returns a time provider function for t.

()

Source from the content-addressed store, hash-verified

79
80// NowFunc returns a time provider function for t.
81func (t *ClockTimeWithOffset) NowFunc() func() time.Time {
82 return func() time.Time {
83 t.mu.Lock()
84 defer t.mu.Unlock()
85
86 return clock.Now().Add(t.offset)
87 }
88}
89
90// Advance increases the time offset by dt, such that the next call to
91// t.NowFunc()() returns current time + new offset.

Calls 4

NowFunction · 0.92
LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.45