SetTimeout sets a timeout with the specified duration and callback The function returns the timeout id which can be used to cancel the timeout
(td time.Duration, arg interface{}, cb TimerCallback)
| 45 | // SetTimeout sets a timeout with the specified duration and callback |
| 46 | // The function returns the timeout id which can be used to cancel the timeout |
| 47 | func (tm *TimerManager) SetTimeout(td time.Duration, arg interface{}, cb TimerCallback) int { |
| 48 | |
| 49 | return tm.setTimer(td, false, arg, cb) |
| 50 | } |
| 51 | |
| 52 | // SetInterval sets a periodic timeout with the specified duration and callback |
| 53 | // The function returns the timeout id which can be used to cancel the timeout |