Documentation
¶
Overview ¶
Package fakeclock is a clock tests advance by hand: Now stands still and AfterFunc callbacks run only inside Advance, in due order, so a countdown's expiry is an assertion rather than a race against the scheduler.
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 the hand-driven clock; New starts it at a fixed instant.
func (*Clock) Advance ¶
Advance moves the clock d forward, running every timer due by then in due order (arming order breaks ties), each with Now at its due instant and outside the clock's lock, so a callback may arm more.