Documentation ¶
Overview ¶
基于小根堆的定时器 在github.com\Terry-Mao\goim\libs\time基础上 增加超时函数参数,去掉log4go
Index ¶
Constants ¶
View Source
const (
Debug = false
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
func NewTimer ¶
A heap must be initialized before any of the heap operations can be used. Init is idempotent with respect to the heap invariants and may be called whenever the heap invariants may have been invalidated. Its complexity is O(n) where n = h.Len().
func (*Timer) Add ¶
Push pushes the element x onto the heap. The complexity is O(log(n)) where n = h.Len().
Click to show internal directories.
Click to hide internal directories.