MCPcopy
hub / github.com/dropbox/godropbox / After

Method After

time2/mock_clock.go:106–117  ·  view source on GitHub ↗
(d time.Duration)

Source from the content-addressed store, hash-verified

104}
105
106func (c *MockClock) After(d time.Duration) <-chan time.Time {
107 c.mutex.Lock()
108 defer c.mutex.Unlock()
109
110 w := &wakeup{
111 t: c.now.Add(d),
112 c: make(chan time.Time),
113 }
114 c.logf("MockClock: registering wakeup in %s at %s.", d.String(), tsStr(w.t))
115 heap.Push(&c.wakeups, w)
116 return w.c
117}
118
119func (c *MockClock) Sleep(d time.Duration) {
120 <-c.After(d)

Callers 1

SleepMethod · 0.95

Calls 7

logfMethod · 0.95
tsStrFunction · 0.85
PushMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected