Documentation
¶
Overview ¶
Package fakeclock is a manual clock for tests of code that schedules with callbacks (healthcheck.Clock): time only moves with Advance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock is a manual clock. The zero value is not usable; use New.
func (*Clock) Advance ¶
Advance moves the clock forward by d and starts the callbacks of the timers that are due, earliest first.
func (*Clock) AfterFunc ¶
AfterFunc arranges for f to run in its own goroutine once the clock has been advanced by d (a delay of 0 or less: at the next Advance). The returned function cancels it and reports whether it was still armed.