timer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireTimer

func AcquireTimer(timeout time.Duration) *time.Timer

AcquireTimer returns a time.Timer from the pool and updates it to send the current time on its channel after at least timeout.

The returned Timer may be returned to the pool with ReleaseTimer when no longer needed. This allows reducing GC load.

func InitTimer

func InitTimer(t *time.Timer, timeout time.Duration) *time.Timer

func ReleaseTimer

func ReleaseTimer(t *time.Timer)

ReleaseTimer returns the time.Timer acquired via AcquireTimer to the pool and prevents the Timer from firing.

Do not access the released time.Timer or read from it's channel otherwise data races may occur.

func StopTimer

func StopTimer(t *time.Timer)

Types

This section is empty.

Jump to

Keyboard shortcuts

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