Versions in this module Expand all Collapse all v1 v1.0.1 Apr 30, 2024 Changes in this version + const ClockEventRateIncrease + const ClockEventSet + const CtxRealtimeClock + const MaxDuration + const MinDuration + var MaxTime = Time + var MinTime = Time + var ZeroTime = Time + func ItimerspecFromSetting(now Time, s Setting) linux.Itimerspec + func SpecFromSetting(now Time, s Setting) (value, period time.Duration) + type ChannelNotifier chan struct + func (c ChannelNotifier) NotifyTimer(uint64, Setting) (Setting, bool) + type Clock interface + Now func() Time + WallTimeUntil func(t, now Time) time.Duration + func RealtimeClockFromContext(ctx context.Context) Clock + type ClockEventsQueue struct + func (*ClockEventsQueue) Readiness(mask waiter.EventMask) waiter.EventMask + func (c *ClockEventsQueue) EventRegister(e *waiter.Entry) error + type Listener interface + NotifyTimer func(exp uint64, setting Setting) (newSetting Setting, update bool) + func NewChannelNotifier() (Listener, <-chan struct{}) + type NoClockEvents struct + func (*NoClockEvents) EventRegister(e *waiter.Entry) error + func (*NoClockEvents) EventUnregister(e *waiter.Entry) + func (*NoClockEvents) Readiness(mask waiter.EventMask) waiter.EventMask + type Setting struct + Enabled bool + Next Time + Period time.Duration + func SettingFromAbsSpec(value Time, interval time.Duration) (Setting, error) + func SettingFromItimerspec(its linux.Itimerspec, abs bool, c Clock) (Setting, error) + func SettingFromSpec(value time.Duration, interval time.Duration, c Clock) (Setting, error) + func SettingFromSpecAt(value time.Duration, interval time.Duration, now Time) (Setting, error) + func (s Setting) At(now Time) (Setting, uint64) + type Time struct + func FromNanoseconds(ns int64) Time + func FromSeconds(s int64) Time + func FromTimespec(ts linux.Timespec) Time + func FromTimeval(tv linux.Timeval) Time + func FromUnix(s int64, ns int64) Time + func NowFromContext(ctx context.Context) Time + func (t Time) Add(d time.Duration) Time + func (t Time) AddTime(u Time) Time + func (t Time) After(u Time) bool + func (t Time) Before(u Time) bool + func (t Time) Equal(u Time) bool + func (t Time) IsMin() bool + func (t Time) IsZero() bool + func (t Time) Microseconds() int64 + func (t Time) Nanoseconds() int64 + func (t Time) Seconds() int64 + func (t Time) StatxTimestamp() linux.StatxTimestamp + func (t Time) String() string + func (t Time) Sub(u Time) time.Duration + func (t Time) TimeT() linux.TimeT + func (t Time) Timespec() linux.Timespec + func (t Time) Timeval() linux.Timeval + func (t Time) Unix() (s int64, ns int64) + type Timer struct + func NewTimer(clock Clock, listener Listener) *Timer + func (t *Timer) Clock() Clock + func (t *Timer) Destroy() + func (t *Timer) Get() (Time, Setting) + func (t *Timer) Pause() + func (t *Timer) Resume() + func (t *Timer) SetClock(c Clock, s Setting) + func (t *Timer) Swap(s Setting) (Time, Setting) + func (t *Timer) SwapAnd(s Setting, f func()) (Time, Setting) + func (t *Timer) Tick() + type VariableTimer struct + func AfterFunc(clock Clock, duration time.Duration, fn func()) *VariableTimer + func (r *VariableTimer) Reset(d time.Duration) + func (r *VariableTimer) Stop() bool + type WallRateClock struct + func (*WallRateClock) WallTimeUntil(t, now Time) time.Duration