()
| 119 | } |
| 120 | |
| 121 | func (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. |
no test coverage detected