Documentation ¶
Index ¶
Constants ¶
const DefaultInitDuration = 5 * time.Millisecond
const DefaultMaxDuration = 1 * time.Second
const DefaultStepTimes = 2
const ZeroDuration = 0
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Delay ¶
type Delay struct { InitDuration time.Duration MaxDuration time.Duration DelayAgainHandler func(delay time.Duration) time.Duration // contains filtered or unexported fields }
func NewDefaultDelay ¶
func NewDefaultDelay() *Delay
type Timer ¶
https://github.com/golang/go/issues/27169 Timer to fix time: Timer.Stop documentation example easily leads to deadlocks
func (*Timer) Reset ¶
Reset changes the timer to expire after duration d. Reset can be invoked anytime, which enhances std time.Reset Reset == std [Stop + drain + Reset] It returns true if the timer had been active, false if the timer had expired or been stopped.
func (*Timer) Stop ¶
Stop prevents the Timer from firing, with the channel drained. Stop ensures the channel is empty after a call to Stop. Stop == std [Stop + drain] It returns true if the call stops the timer, false if the timer has already expired or been stopped. Stop does not close the channel, to prevent a read from the channel succeeding incorrectly.