timer

package module
Version: v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2017 License: Apache-2.0 Imports: 6 Imported by: 180

README

goTimer

Timer framework in Golang

Documentation

Index

Constants

View Source
const (
	MIN_TIMER_INTERVAL = 1 * time.Millisecond
)

Variables

This section is empty.

Functions

func StartTicks

func StartTicks(tickInterval time.Duration)

Start the self-ticking routine, which ticks per tickInterval

func Tick

func Tick()

Tick once for timers

Types

type CallbackFunc

type CallbackFunc func()

Type of callback function

type Timer added in v0.0.3

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

func AddCallback

func AddCallback(d time.Duration, callback CallbackFunc) *Timer

Add a callback which will be called after specified duration

func AddTimer

func AddTimer(d time.Duration, callback CallbackFunc) *Timer

Add a timer which calls callback periodly

func (*Timer) Cancel added in v0.0.3

func (t *Timer) Cancel()

func (*Timer) IsActive added in v0.0.3

func (t *Timer) IsActive() bool

Source Files

Jump to

Keyboard shortcuts

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