MCPcopy
hub / github.com/aceld/zinx / AddTimer

Method AddTimer

ztimer/timewheel.go:133–138  ·  view source on GitHub ↗

AddTimer 添加一个timer到一个时间轮中(非时间轮自转情况)

(tID uint32, t *Timer)

Source from the content-addressed store, hash-verified

131
132// AddTimer 添加一个timer到一个时间轮中(非时间轮自转情况)
133func (tw *TimeWheel) AddTimer(tID uint32, t *Timer) error {
134 tw.Lock()
135 defer tw.Unlock()
136
137 return tw.addTimer(tID, t, false)
138}
139
140// RemoveTimer 删除一个定时器,根据定时器的ID
141func (tw *TimeWheel) RemoveTimer(tID uint32) {

Callers 4

TestTimerWheelFunction · 0.95
addTimerMethod · 0.80
CreateTimerAtMethod · 0.80
CreateTimerAfterMethod · 0.80

Calls 1

addTimerMethod · 0.95

Tested by 1

TestTimerWheelFunction · 0.76