timer

package
v0.0.3 Latest Latest
Warning

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

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

README

通用计时器

时间表示为 int64 Unix 时间

用层级的方式处理任意长度的定时器消息

Documentation

Index

Constants

View Source
const (
	TIMER_LEVEL = 20 // 时间段最大分级,最大时间段为 2^TIMERLEVEL
	QUEUE_MAX   = 65536
)

Variables

This section is empty.

Functions

func Add

func Add(id int32, timeout int64, ch chan int32)

------------------------------------------------ 添加一个定时,timeout为到期的Unix时间 id 是调用者定义的编号, 事件发生时,会把id发送到ch

Types

This section is empty.

Jump to

Keyboard shortcuts

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