Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MonotonicTicker ¶
type MonotonicTicker struct {
// After the ticker is started (using Start()), periodic
// writes will occur on this channel. The value is the
// approximate number of ticks that have occurred since the
// last channel read. However, while the channel blocks
// for the receiver, it does not block from the ticker, so
// if a read is missed, one or more ticks may be lost.
C chan uint64
// contains filtered or unexported fields
}
A MonotonicTicker is a ticker using a monotonic clock.
func NewMonotonicTicker ¶
func NewMonotonicTicker(interval time.Duration) *MonotonicTicker
NewMonotonicTicker creates a ticker that is intended to fire a tick near every interval.
func (*MonotonicTicker) Start ¶
func (ticker *MonotonicTicker) Start() error
Start starts the ticker. Writes to ticker.C should now occur according to the interval configured in the constructor. Each time Start() is run, the ticker.C channel is replaced with a new one. Once a ticker is started, Start() cannot be run again until Stop() is run on the ticker.
func (*MonotonicTicker) Stop ¶
func (ticker *MonotonicTicker) Stop() error
Stop stops a running ticker. The associated channel will be closed from the ticker side.
Click to show internal directories.
Click to hide internal directories.