Crate time_this

source ·

Macros

  • this macro can be used to time any expression you want using std::time::Instant. It returns the result of the expression, similar to dbg!(). It may not work correctly with async fn. It will print:

Attribute Macros

  • this macro can be used to time any function you want using std::time::Instant. It may not work correctly with async fn and it definitely doesn’t work with const fn (even if called in a non-const context. You can write a small wrapping fn if you need to time a const fn). It will print: