timetool

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package timetool provides time utilities.

Index

Constants

This section is empty.

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