update_rate

A generic, low-overhead update rate counter for FPS counters and the like

Downloads
15.6K
Stars
3
Committers
3

update_rate

A generic, low-overhead rate counter for frames-per-second indicators, measurement averaging, and more.

use update_rate::{RateCounter, RollingRateCounter};

let mut c = RollingRateCounter::new(10);

loop {
    c.update();
    mycrate.work(); // Perform the slow operation
    println!("Updating at {}", c); 
}