Macros
- this macro can be used to time any expression you want using
std::time::Instant. It returns the result of the expression, similar todbg!(). It may not work correctly withasync 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 withasync fnand it definitely doesn’t work withconst fn(even if called in a non-const context. You can write a small wrapping fn if you need to time aconst fn). It will print: