Documentation
¶
Overview ¶
Package clock is the time source of components that show the time or arm countdowns: the wall clock in the shell, internal/fakeclock in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock interface {
Now() time.Time
// AfterFunc runs fn once d has passed; stop disarms it, reporting
// whether it was still armed.
AfterFunc(d time.Duration, fn func()) (stop func() bool)
}
Clock reads the time and arms one-shot timers.
type Wall ¶
type Wall struct {
// contains filtered or unexported fields
}
Wall is the machine's wall clock: Now reads it in the time zone set now, not the one the shell started in, and Changes ticks when the zone changes or the clock jumps.
func (*Wall) Changes ¶
func (w *Wall) Changes() (<-chan struct{}, func())
Changes ticks after every change of the time zone and every jump of the clock; stop ends the feed.