time

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Nanosecond  = time.Nanosecond
	Microsecond = time.Microsecond
	Millisecond = time.Millisecond
	Second      = time.Second
	Minute      = time.Minute
	Hour        = time.Hour
	Day         = 24 * time.Hour
)
View Source
const InfiniteTimes = tools.InfiniteTimes
View Source
const Layout = "2006-01-02 15:04:05.000"
View Source
const LayoutSec = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func DebugAddTimeDuration

func DebugAddTimeDuration(d Duration) error

func DebugSetNowTime

func DebugSetNowTime(timeStr string, local *Location) error

func DebugSetNowTimeLocal

func DebugSetNowTimeLocal(timeStr string) error

func DebugSetNowTimeUTC

func DebugSetNowTimeUTC(timeStr string) error

func Sleep

func Sleep(d Duration)

Types

type Duration

type Duration = time.Duration

type Location

type Location = time.Location

type Time

type Time = time.Time

func Now

func Now() Time

func Unix

func Unix(sec int64, nsec int64) Time

type Timer

type Timer = heap_timer.Timer

func NewTick

func NewTick(ctx any, h TimerHandler, dur Duration, repeat int) Timer

func NewTickWithFirstDo

func NewTickWithFirstDo(ctx any, h TimerHandler, firstFireAt time.Time, dur Duration, repeat int) Timer

func NewTimer

func NewTimer(ctx any, h TimerHandler, dur Duration) Timer

NewTimer 创建一个定时器, 返回的Timer只能在指定goroutine中操作Reset和 Kill

func NewTimerWithFirstDo

func NewTimerWithFirstDo(ctx any, h TimerHandler, fireAt time.Time) Timer

type TimerChannel

type TimerChannel = heap_timer.TimerChannel

type TimerHandler

type TimerHandler interface {
	OnTime(msg TimerMsg)
}

type TimerMsg

type TimerMsg = heap_timer.TimerMsg

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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