timer

package
v0.0.0-...-a5ab9ee Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	InvalidHTimer = 0
)

Variables

This section is empty.

Functions

func GetLeftTime

func GetLeftTime(uid HTimer) int64

获取定时器剩余时长,传入SetTimer返回的句柄

func KillTimer

func KillTimer(uid HTimer)

停止定时器,传入SetTimer返回的句柄

Types

type HTimer

type HTimer uint64

func SetTimer

func SetTimer(interval int64, count uint32, callback func(interface{}) bool, args interface{}) HTimer

添加定时器 interval 定时间隔(ms) count 触发次数(-1为永远触发) callback 回调 args 回调参数 return 定时器句柄

type Manager

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

定时器

Jump to

Keyboard shortcuts

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