pub fn tick(&mut self) -> time::Duration {
        let prev_offset = match self.offset {
            0 => self.times.len() - 1,
            _ => self.offset - 1
        };

        self.times[self.offset] = time::Instant::now();
        let old_time = self.times[prev_offset];
        let time = self.times[self.offset].duration_since(old_time);
        self.offset = (self.offset + 1) % self.times.len();
        time
    }
/// Call this function every time the given event happens.
/// You will be able to retrieve the average time between calls to `tick`
/// using the `average_time` function.
///
/// Returns the time between the previous tick and this tick.
Call this function every time the given event happens.
You will be able to retrieve the average time between calls to `tick`
using the `average_time` function.

Returns the time between the previous tick and this tick.
Call this function every time the given event happens . You will be able to retrieve the average time between calls to ` tick ` using the ` average_time ` function . Returns the time between the previous tick and this tick .
pub fn tick(&mut self) -> time::Duration {
        let prev_offset = match self.offset {
            0 => self.times.len() - 1,
            _ => self.offset - 1
        };
        self.times[self.offset] = time::Instant::now();
        let old_time = self.times[prev_offset];
        let time = self.times[self.offset].duration_since(old_time);
        self.offset = (self.offset + 1) % self.times.len();
        time
    }
pub fn tick ( & mut self ) -> time :: Duration { let prev_offset = match self . offset { 0 => self . times . len ( ) - 1 , _ => self . offset - 1 } ; self . times [ self . offset ] = time :: Instant :: now ( ) ; let old_time = self . times [ prev_offset ] ; let time = self . times [ self . offset ] . duration_since ( old_time ) ; self . offset = ( self . offset + 1 ) % self . times . len ( ) ; time }
Call this function every time the given event happens.
Call this function every time the given event happens .
&mut self
&mut self