(delay uint64, op TimerHandler, args ...interface{})
| 56 | } |
| 57 | |
| 58 | func (this *TimerManager) AddTimer(delay uint64, op TimerHandler, args ...interface{}) uint64 { |
| 59 | seqID := this.GetSeqID() |
| 60 | |
| 61 | if delay < 0 { |
| 62 | delay = 0 |
| 63 | } |
| 64 | |
| 65 | run_tick := UnixTS() + delay |
| 66 | |
| 67 | if run_tick > 0x000000ffffffffff { |
| 68 | run_tick = run_tick & 0x000000ffffffffff |
| 69 | } |
| 70 | |
| 71 | xtimer := this.pool.Get() |
| 72 | xtimer.args = args |
| 73 | xtimer.handler = op |
| 74 | xtimer.next = nil |
| 75 | xtimer.running = false |
| 76 | xtimer.seqID = seqID |
| 77 | xtimer.runTick = run_tick |
| 78 | |
| 79 | this.timer_wheels[4].add_timer(xtimer) |
| 80 | |
| 81 | return xtimer.get_timer_id() |
| 82 | } |
| 83 | |
| 84 | func (this *TimerManager) DeleteTimer(timerID uint64) bool { |
| 85 | if timerID == 0 { |
nothing calls this directly
no test coverage detected