Crates.io | simple_func_timer |
lib.rs | simple_func_timer |
version | 0.1.0 |
source | src |
created_at | 2021-05-09 09:01:55.048595 |
updated_at | 2021-05-09 09:01:55.048595 |
description | Simple macro to measure the function execution time in Rust |
homepage | https://github.com/mkinoshi/simple_func_timer |
repository | https://github.com/mkinoshi/simple_func_timer |
max_upload_size | |
id | 395128 |
size | 13,685 |
Tiny macro to measure the function execution time in Rust. It uses log
crate, so the consuming code can handle the log easily.
You can measure the execution time of a function in the following way. Your client code needs to consume the log.
#[timer(unit = "ns", log = "info")]
fn my_function() {
}
// It measures the execution time in milliseconds and generate `debug` level logs by default.
#[timer]
fn my_function() {
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate. Enjoy!