timetool

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RFC3339Milli follows RFC3339 format with milliseconds for precision
	RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedTimer

type DistributedTimer struct {
	C chan time.Time
	// contains filtered or unexported fields
}

DistributedTimer keeps timer's tick time consistent. Please notice nextDurationFunc assumes different instances running under the same system clock.

func NewDistributedTimer

func NewDistributedTimer(nextDurationFunc NextDurationFunc) *DistributedTimer

NewDistributedTimer creates a DistributedTimer

func (*DistributedTimer) Close

func (dt *DistributedTimer) Close()

Close closes DistributedTimer.

type NextDurationFunc

type NextDurationFunc func() time.Duration

NextDurationFunc is the type for registering callback function to determinate the timer to tick after the returned duration.

Jump to

Keyboard shortcuts

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