The Rust macros that used to estimate function call time cost.
-
Clone this repositry
git clone https://github.com/li195111/qctimer_macros.git
-
Go to the project that you want to use
qctimer
-
Add dependencies as following
[dependencies] qctimer_macros = { path = "< PATH / TO / qctimer_macros >" }
use qctimer_macros::timer;
#[timer]
fn function_you_want_estimate(...) {
...
}
use qctimer_macros::async_timer;
#[async_timer]
async fn async_function_you_want_estimate(...) {
...
}
It will println
following messages.
function_you_want_estimate Time Cost: 3 ms.
another_function_you_want_estimate Time Cost: 637 µs.