| Crates.io | utils-box-stopwatch |
| lib.rs | utils-box-stopwatch |
| version | 1.0.1 |
| created_at | 2025-11-03 08:17:19.343106+00 |
| updated_at | 2025-11-03 08:17:19.343106+00 |
| description | A toolbox of various small RUST utilities that make measuring code execution easier |
| homepage | |
| repository | https://github.com/klispap/utils-box |
| max_upload_size | |
| id | 1914212 |
| size | 59,823 |
A toolbox library that holds a useful collection of small unitilies written in Rust that make our life easier when writting Rust applications.
Keep track of execution times in various points in binaries. Print records.
Minimal Example:
let mut s = TimeKeeper::init();
let mut t = TimeKeeper::init();
s.totals();
s.lap("init");
for _ in 0..5 {
std::thread::sleep(Duration::from_millis(5));
s.lap("loop");
t.lap("loop");
}
s.lap_totals("loop");
std::thread::sleep(Duration::from_millis(1234));
s.lap("after");
s.totals();
t.totals();
s.merge(t);
s.totals();
Make sure you have the following system-level dependencies installed:
sudo apt install pkg-config build-essential fontconfig libfontconfig1-dev
Verify that pkg-config can detect libstdc++ properly:
pkg-config --libs libstdc++
If libstdc++ is not detected, add the symbolic link:
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11/libstdc++.so /usr/lib/libstdc++.so