NewClock creates a Clock with the specified settings. To create a Clock with only the default settings, new(Clock) is equivalent, except that the start time will not be computed until one of the receivers is called.
(co ClockOpts)
| 53 | // Clock with only the default settings, new(Clock) is equivalent, except that |
| 54 | // the start time will not be computed until one of the receivers is called. |
| 55 | func NewClock(co ClockOpts) *Clock { |
| 56 | if co.FollowRealTime && co.Step != 0 { |
| 57 | panic("only one of FollowRealTime and Step are allowed in NewClock") |
| 58 | } |
| 59 | |
| 60 | return newClockInternal(co, nil) |
| 61 | } |
| 62 | |
| 63 | // newClockInternal creates a Clock with the specified settings and allows |
| 64 | // specifying a non-standard realTimeClock. |
searching dependent graphs…