Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AdvanceToAfter ¶ added in v1.1.0
func AdvanceToAfter()
AdvanceToAfter is a synchronization function that will advance to the time of the next After() call, waiting for a call to After() if necessary. Note that this will also include timers.
func Mock ¶
func Mock()
Mock replaces the time functions in this package with their mocked equivalents. Note that this is intended to be called at the beginning of a test and used with an associated defer Unmock() call. It is not safe for Mock or Unmock to be called from other goroutines, although the other mocked functions and types may be used anywhere while mocking is active.
func MockAfter ¶
MockAfter returns a channel that will send when the specified duration elapses via calls to Set or Advance.
Types ¶
type Ticker ¶ added in v1.3.0
Ticker provides a drop-in replacement for time.Ticker.
func NewTicker ¶ added in v1.3.0
NewTicker creates a new Ticker that will send on the channel C every time the specified duration elapses.