fps_ticker 1.0.0

A simple crate for measuring the average, minimum and maximum frame rate over a window of time.
Documentation
  • Coverage
  • 100%
    8 out of 8 items documented1 out of 7 items with examples
  • Size
  • Source code size: 8.04 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.35 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • mitchmindtree/fps_ticker
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mitchmindtree

fps_ticker Crates.io docs.rs

A simple crate for measuring the average, minimum and maximum frame rate over a window of time.

Usage

Specify a window length over which the average, minimum and maximum values will be measured.

use fps_ticker::Fps;

fn main() {
    let fps = Fps::with_window_len(100);
}

Or create an instance with the default window length of 60.

let fps = Fps::default();

Call tick once per frame at the point at which you wish to measure the rate. This samples the duration since the last tick, adds it to the window, removes the oldest duration from the window if necessary and re-calculates the average, minimum and maximum rate over the resulting window.

fps.tick();

Now we can retrieve the average, minimum and maximum rate over the window of time.

fps.avg();
fps.min();
fps.max();