calculagraph

Attribute Macro timer_log_info

Source
#[timer_log_info]
Expand description

log::info! the execution time after the function is called and executed,

The macro support none, 1 or 2 parameters, [(TimeUnit[, FormatString])]. The parameter TimeUnit supports four types of s, ms(by default), us and ns, The parameter FormatString is similar to the format string parameter in println!, note that only one placeholder is supported here, which will fill the time result.

ยงExamples

#[timer_log_info]
fn func() {}

#[timer_log_info(ns)]
fn func1() {}

#[timer_log_info(ns, "func2() execution time: {}ns")]
fn func2() {}