| Crates.io | howlast |
| lib.rs | howlast |
| version | 0.1.2 |
| created_at | 2025-04-12 04:51:57.336413+00 |
| updated_at | 2025-04-20 15:35:09.510519+00 |
| description | A procedural macro to easily misure computation times. |
| homepage | https://github.com/mad4j/howlast |
| repository | https://github.com/mad4j/howlast |
| max_upload_size | |
| id | 1630628 |
| size | 41,051 |
howlast is a Rust procedural macro designed for timing code execution.
It provides an easy way to measure the duration of specific code blocks, helping developers optimize performance.
To use howlast, add it as a dependency in your Cargo.toml file:
[dependencies]
howlast = "0.1.2"
Then, include the macro in your Rust code:
use howlast::howlast;
Here's an example of how to use the howlast macro:
use howlast::howlast;
fn main() {
howlast!(step_duration => {
let x = 1 + 1;
std::thread::sleep(std::time::Duration::from_secs(1));
x
});
print!("{:?}", step_duration);
howlast!(step_duration, result => {
let x = 1 + 1;
std::thread::sleep(std::time::Duration::from_secs(1));
x
});
print!("{:?} {:?}", step_duration, result);
howlast!(step_duration, result => 2+2);
print!("{:?} {:?}", step_duration, result);
}
This will output the execution time of the code block along with the result of the computation.