| Crates.io | calculagraph |
| lib.rs | calculagraph |
| version | 0.1.0 |
| created_at | 2021-08-22 10:01:10.978876+00 |
| updated_at | 2021-08-22 10:01:10.978876+00 |
| description | A handy library for measuring the execution time of function |
| homepage | |
| repository | https://github.com/kookyleo/calculagraph |
| max_upload_size | |
| id | 440623 |
| size | 23,112 |
A handy library for measuring the execution time of function.
[dependencies]
calculagraph = "0.1"
use std::{thread, time};
use calculagraph::timer_println;
#[timer_println(ms)]
fn main() {
thread::sleep(time::Duration::from_millis(10));
println!("job done");
}
The above example will print fn:main cost 10ms at the end, You can also use the second
argument to define the format string you need.