ticker

package
v0.0.0-...-b1cb840 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 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 {
	Duration time.Duration
	C        <-chan time.Time
	// contains filtered or unexported fields
}

Ticker is an implementation of resetable ticker

It keeps a constant Duration D, and when `Reset()“ is called, the ticker will be reset and next tick will arrive at least after D from the reset time.

func NewTicker

func NewTicker(d time.Duration) *Ticker

NewTicker returns a new Ticker with duration d

func (*Ticker) Reset

func (t *Ticker) Reset()

Reset will reset the ticker, and next tick will arrive after d from the reset time.

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop turns off the ticker. There will be no more tick arrives after Stop() is called.

Jump to

Keyboard shortcuts

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