lazytime

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: ISC 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 {
	C <-chan time.Time
	// contains filtered or unexported fields
}

func (*Ticker) Reset

func (t *Ticker) Reset(d time.Duration)

Reset resets the ticker. If this is the first time calling, then a new timer is created.

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop stops the ticker. If the ticker has never been used, then it does nothing.

type Timer

type Timer struct {
	C <-chan time.Time
	// contains filtered or unexported fields
}

func (*Timer) Reset

func (t *Timer) Reset(d time.Duration)

Reset resets the timer by draining it and resetting the internal channel. If this is the first time calling, then a new timer is created.

func (*Timer) Stop

func (t *Timer) Stop()

Stop stops the timer and drains it. If the timer has never been used, then it does nothing.

func (*Timer) Wait

func (t *Timer) Wait(ctx context.Context) error

Wait blocks until the timer fires or until the context expires.

Jump to

Keyboard shortcuts

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