MCPcopy
hub / github.com/coocood/freecache / Now

Method Now

cache_test.go:26–33  ·  view source on GitHub ↗

Now mock logic.

()

Source from the content-addressed store, hash-verified

24
25// Now mock logic.
26func (mock *mockTimer) Now() uint32 {
27 atomic.AddUint32(&mock.nowCallsCnt, 1)
28 if mock.nowCallback != nil {
29 return mock.nowCallback()
30 }
31
32 return uint32(time.Now().Unix())
33}
34
35// SetNowCallback sets the callback to be executed inside Now().
36// You can control the return value this way.

Callers

nothing calls this directly

Calls 1

NowMethod · 0.65

Tested by

no test coverage detected