Documentation ¶
Overview ¶
Package clock provides tools for accessing time functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clock ¶
type Clock interface { Now() time.Time Since(t time.Time) time.Duration Until(t time.Time) time.Duration Sleep(d time.Duration) Timer(d time.Duration) Timer After(d time.Duration) <-chan time.Time AfterFunc(d time.Duration, f func()) Timer Ticker(d time.Duration) Ticker WithDeadline(parent context.Context, deadline time.Time) (context.Context, context.CancelFunc) WithTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) }
Clock is an interface for accessing time functions
func FromContext ¶
FromContext returns Clock from context
Click to show internal directories.
Click to hide internal directories.