pub fn tick_frame(&mut self) {
        let time_elapsed = self.counter.elapsed();
        self.counter = Instant::now();

        self.delta_frame = time_elapsed.subsec_micros();
        self.samples[self.current_frame] = self.delta_frame;
        self.current_frame = (self.current_frame + 1) % FPS_SAMPLE_COUNT;


        if self.is_tick_second() {
            self.second_counter = 0;
        } else {
            self.second_counter += self.delta_frame;
        }
    }
/// Call this function in game loop to update its inner status.
Call this function in game loop to update its inner status.
Call this function in game loop to update its inner status .
pub fn tick_frame(&mut self) {
        let time_elapsed = self.counter.elapsed();
        self.counter = Instant::now();
        self.delta_frame = time_elapsed.subsec_micros();
        self.samples[self.current_frame] = self.delta_frame;
        self.current_frame = (self.current_frame + 1) % FPS_SAMPLE_COUNT;
        if self.is_tick_second() {
            self.second_counter = 0;
        } else {
            self.second_counter += self.delta_frame;
        }
    }
pub fn tick_frame ( & mut self ) { let time_elapsed = self . counter . elapsed ( ) ; self . counter = Instant :: now ( ) ; self . delta_frame = time_elapsed . subsec_micros ( ) ; self . samples [ self . current_frame ] = self . delta_frame ; self . current_frame = ( self . current_frame + 1 ) % FPS_SAMPLE_COUNT ; if self . is_tick_second ( ) { self . second_counter = 0 ; } else { self . second_counter += self . delta_frame ; } }
Call this function in game loop to update its inner status.
Call this function in game loop to update its inner status .
&mut self
&mut self