time_

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInitDuration = 5 * time.Millisecond
View Source
const DefaultMaxDuration = 1 * time.Second
View Source
const DefaultStepTimes = 2
View Source
const ZeroDuration = 0

Variables

This section is empty.

Functions

func After added in v1.0.20

func After(d time.Duration) <-chan time.Time

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

func (*Delay) Delay

func (d *Delay) Delay() <-chan time.Time

func (*Delay) DelayFunc

func (d *Delay) DelayFunc(f func()) *time.Timer

func (*Delay) Duration

func (d *Delay) Duration() time.Duration

func (*Delay) Reset

func (d *Delay) Reset()

func (*Delay) Sleep

func (d *Delay) Sleep()

func (*Delay) Update

func (d *Delay) Update()

type Timer added in v1.0.20

type Timer struct {
	*time.Timer
	// contains filtered or unexported fields
}

func AfterFunc added in v1.0.20

func AfterFunc(d time.Duration, f func()) *Timer

func NewTimer added in v1.0.20

func NewTimer(d time.Duration) *Timer

func WrapTimer added in v1.0.20

func WrapTimer(t *time.Timer) *Timer

func (*Timer) ChanConsumed added in v1.0.20

func (t *Timer) ChanConsumed()

saw channel read, must be called after receiving value from timer chan

func (*Timer) Reset added in v1.0.20

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

Jump to

Keyboard shortcuts

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