pub fn start(&mut self, time_after: Time, data: T) {
        //debug!("{:?} {:?}", self.tick, time_after);
        let time = self.tick + time_after;
        let event = Event { time, data };
        let mut it = self.timers.iter();
        let mut i : usize = 0;
        loop {
            match it.next() {
                None => break,
                Some(e) if e.time >= time => break,
                _ => {}
            }
            i += 1;
        }
        self.timers.insert(i, event);
    }
/// Start a timer with given time interval
Start a timer with given time interval
Start a timer with given time interval
pub fn start(&mut self, time_after: Time, data: T) {
        //debug!("{:?} {:?}", self.tick, time_after);
        let time = self.tick + time_after;
        let event = Event { time, data };
        let mut it = self.timers.iter();
        let mut i : usize = 0;
        loop {
            match it.next() {
                None => break,
                Some(e) if e.time >= time => break,
                _ => {}
            }
            i += 1;
        }
        self.timers.insert(i, event);
    }
pub fn start ( & mut self , time_after : Time , data : T ) { //debug!("{:?} {:?}", self.tick, time_after); let time = self . tick + time_after ; let event = Event { time , data } ; let mut it = self . timers . iter ( ) ; let mut i : usize = 0 ; loop { match it . next ( ) { None => break , Some ( e ) if e . time >= time => break , _ => { } } i += 1 ; } self . timers . insert ( i , event ) ; }
Start a timer with given time interval
Start a timer with given time interval
&mut self
time_after
Time
data
T
&mut self
time_after
Time
data
T