timer

package
v0.0.0-...-d07672d Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedTimer

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

CachedTimer 存储每秒 Unix 时间戳,并返回缓存的值

func NewCachedTimer

func NewCachedTimer() *CachedTimer

创建和启动 CachedTimer 计时器,每秒更新一次时间戳。

func (*CachedTimer) Now

func (t *CachedTimer) Now() int64

返回当前 Unix 时间戳值

func (*CachedTimer) Stop

func (t *CachedTimer) Stop()

停止计时器,结束时间戳更新协程。

Jump to

Keyboard shortcuts

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