| Crates.io | frame_counter |
| lib.rs | frame_counter |
| version | 0.1.3 |
| created_at | 2021-04-02 19:36:14.277999+00 |
| updated_at | 2025-09-02 22:23:20.397842+00 |
| description | simple frame counter and limiter |
| homepage | |
| repository | https://github.com/ko1N/frame_counter |
| max_upload_size | |
| id | 377855 |
| size | 22,280 |
The frame_counter library provides a very simple to use framerate counter based around the rust time module.
Additionally the FrameCounter can also be used to cap the framerate at a certain value either in a hot or cold loop.
Counting the framerate:
use frame_counter::FrameCounter;
pub fn dummy_workload() {
std::thread::sleep(std::time::Duration::from_millis(10));
}
pub fn main() {
let mut frame_counter = FrameCounter::default();
loop {
frame_counter.tick();
dummy_workload();
println!("fps stats - {}", frame_counter);
}
}