Documentation
¶
Index ¶
- func NewClock() pkg.Clock
- func NewTicker(d time.Duration) pkg.Ticker
- func NewTimer(d time.Duration) pkg.Timer
- func NewTimerFunc(d time.Duration, f func()) pkg.Timer
- type Clock
- func (c *Clock) After(d time.Duration) <-chan time.Time
- func (c *Clock) AfterFunc(d time.Duration, f func()) pkg.Timer
- func (c *Clock) Now() time.Time
- func (c *Clock) Since(t time.Time) time.Duration
- func (c *Clock) Sleep(d time.Duration)
- func (c *Clock) Tick(d time.Duration) <-chan time.Time
- func (c *Clock) Ticker(d time.Duration) pkg.Ticker
- func (c *Clock) Timer(d time.Duration) pkg.Timer
- func (c *Clock) Until(t time.Time) time.Duration
- func (c *Clock) WithDeadline(parent context.Context, d time.Time) (context.Context, context.CancelFunc)
- func (c *Clock) WithTimeout(parent context.Context, t time.Duration) (context.Context, context.CancelFunc)
- type Ticker
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clock ¶
type Clock struct{}
Clock implements a real-time clock by simply wrapping the time package functions.
func (*Clock) WithDeadline ¶
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
Ticker holds a channel that receives "ticks" at regular intervals.
Click to show internal directories.
Click to hide internal directories.