ticker

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ticker

type Ticker struct {
	Ticks chan time.Time
	// contains filtered or unexported fields
}

Ticker defines time ticker that delivers ticks at intervals

func New

func New(intervals time.Duration) *Ticker

New creates an instance of Ticker that ticks every intervals. It includes some kind of back-pressure for slow receivers

func (*Ticker) Start

func (t *Ticker) Start()

Start the ticker. Ticks are delivered on the ticker's channel until Stop is called

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop stops the ticker. No ticks will be delivered on ticker's channel after Stop returns and before Start is call again

func (*Ticker) Ticking

func (t *Ticker) Ticking() bool

Ticking returns true when the ticker is ticking and false when it is stopped

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL