timer

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGTimer

func SetGTimer(timer *Timer)

Types

type Timer

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

func GTimer

func GTimer() *Timer

func NewTimer

func NewTimer(excutor taskexcutor.Excutor) *Timer

func (*Timer) AddOnceEvent

func (t *Timer) AddOnceEvent(listener *taskexcutor.TaskService, name string, wait time.Duration) (e *TimerEvent)

添加定时事件,事件的回调函数默认第一个参数为 *TimerEvent

func (*Timer) AddTimerEvent

func (t *Timer) AddTimerEvent(listener *taskexcutor.TaskService, name string, initTime, interval time.Duration, count int, absolute bool) (e *TimerEvent)

添加定时事件,事件的回调函数默认第一个参数为 *TimerEvent

type TimerEvent

type TimerEvent struct {
	Name string //事件名称
	// contains filtered or unexported fields
}

func AddOnceEvent

func AddOnceEvent(listener *taskexcutor.TaskService, name string, wait time.Duration) (e *TimerEvent)

添加定时事件,事件的回调函数默认第一个参数为 *TimerEvent

func AddTimerEvent

func AddTimerEvent(listener *taskexcutor.TaskService, name string, initTime, interval time.Duration, count int, absolute bool) (e *TimerEvent)

添加定时事件,事件的回调函数默认第一个参数为 *TimerEvent

func (*TimerEvent) Close

func (e *TimerEvent) Close()

func (*TimerEvent) Closed

func (e *TimerEvent) Closed() bool

func (*TimerEvent) NextTime

func (e *TimerEvent) NextTime() int64

定时器下次执行时间 毫秒

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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