MCPcopy
hub / github.com/uber-go/zap / NewMockClock

Function NewMockClock

internal/ztest/clock.go:47–51  ·  view source on GitHub ↗

NewMockClock builds a new mock clock using the current actual time as the initial time.

()

Source from the content-addressed store, hash-verified

45// NewMockClock builds a new mock clock
46// using the current actual time as the initial time.
47func NewMockClock() *MockClock {
48 return &MockClock{
49 now: time.Now(),
50 }
51}
52
53// Now reports the current time.
54func (c *MockClock) Now() time.Time {

Callers 5

TestSamplerConcurrentFunction · 0.92
TestBufferWriterFunction · 0.92
TestMockClock_NewTickerFunction · 0.85

Calls 1

NowMethod · 0.65

Tested by 5

TestSamplerConcurrentFunction · 0.74
TestBufferWriterFunction · 0.74
TestMockClock_NewTickerFunction · 0.68