com_croftsoft_lib_animation/frame_rater/
mod.rs

1// =============================================================================
2//! - Frame Rater
3//!
4//! # Metadata
5//! - Copyright: © 2023 [`CroftSoft Inc`]
6//! - Author: [`David Wallace Croft`]
7//! - Created: 2023-02-25
8//! - Updated: 2023-03-01
9//!
10//! [`CroftSoft Inc`]: https://www.croftsoft.com/
11//! [`David Wallace Croft`]: https://www.croftsoft.com/people/david/
12// =============================================================================
13
14pub mod simple;
15pub mod updater;
16
17pub trait FrameRater {
18  fn clear(&mut self);
19
20  fn get_frames_per_second_sampled(&self) -> f64;
21
22  fn sample(
23    &mut self,
24    update_time_millis: f64,
25  ) -> bool;
26
27  fn update_frame_sample_size(
28    &mut self,
29    frame_period_millis: f64,
30  );
31}