timer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: AGPL-3.0, 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 Task

type Task struct {
	// contains filtered or unexported fields
}

Task groups together a time.Timer, a Name of the timer, Duration and a cancel channel.

func (*Task) Duration

func (t *Task) Duration() time.Duration

func (*Task) Name

func (t *Task) Name() string

type Timers

type Timers struct {
	C chan *Task
	// contains filtered or unexported fields
}

Timers keeps track of multiple Task instances. When one of the Task expires then it will be sent on C.

func NewTimers

func NewTimers() *Timers

func (*Timers) Restart

func (t *Timers) Restart(name string)

func (*Timers) Start

func (t *Timers) Start(name string, d time.Duration)

func (*Timers) WaitClose

func (t *Timers) WaitClose()

Jump to

Keyboard shortcuts

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