MCPcopy
hub / github.com/tailscale/tailscale / init

Method init

tstest/clock.go:121–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119}
120
121func (c *Clock) init() {
122 c.initOnce.Do(func() {
123 if c.realTimeClock != nil {
124 c.realTime = c.realTimeClock.Now()
125 }
126 if c.start.IsZero() {
127 if c.realTime.IsZero() {
128 c.start = time.Now().UTC()
129 } else {
130 c.start = c.realTime
131 }
132 }
133 if c.timerChannelSize == 0 {
134 c.timerChannelSize = 1
135 }
136 c.present = c.start
137 c.skipStep = true
138 c.events.AdvanceTo(c.present)
139 })
140}
141
142// Now returns the virtual clock's current time, and advances it
143// according to its step configuration.

Callers 12

newClockInternalFunction · 0.95
NowMethod · 0.95
PeekNowMethod · 0.95
AdvanceMethod · 0.95
AdvanceToMethod · 0.95
GetStartMethod · 0.95
GetStepMethod · 0.95
SetStepMethod · 0.95
SetTimerChannelSizeMethod · 0.95
NewTickerMethod · 0.95
NewTimerMethod · 0.95
AfterFuncMethod · 0.95

Implementers 3

DefaultClocktstime/tstime.go
StdClocktstime/tstime.go
Clocktstest/clock.go

Calls 4

DoMethod · 0.65
NowMethod · 0.65
IsZeroMethod · 0.65
AdvanceToMethod · 0.45

Tested by

no test coverage detected