timecache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() time.Time

func Set

func Set(timeCache *TimeCache)

Types

type TimeCache

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

func New

func New(interval time.Duration) *TimeCache

New returns a new TimeCache instance with the specified interval.

The interval parameter specifies the duration between cache refreshes. If interval is 0, it defaults to 1 second; if it's less than 1 millisecond, it defaults to 1 millisecond. *TimeCache

func (*TimeCache) Now

func (tc *TimeCache) Now() time.Time

Now returns the current time from the TimeCache instance.

No parameters. Returns a time.Time value representing the current time.

Jump to

Keyboard shortcuts

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