Crates.io | code-timing-macros |
lib.rs | code-timing-macros |
version | 0.0.5 |
source | src |
created_at | 2024-09-03 01:36:09.049261 |
updated_at | 2024-10-23 02:47:21.116493 |
description | Macros for easily measuring execution time of various code pieces |
homepage | |
repository | https://github.com/rjzak/code-timing-macros |
max_upload_size | |
id | 1361237 |
size | 24,735 |
This crate aims to provide useful, easy to use macros to measure the time taken to execute some code. At present, this is alpha quality, and subject to changes.
Contributions welcomed!
#[time_function]
to a function causes the program to print how long a function took to run when it's finished.time_snippet!()
to report the timing for a snippet (or block) of code.The following crate features are available:
release
: by default, the macros will not modify the code for release builds. This feature prevents that, so release builds will report execution time.tracing
: by default, the macros will print elapsed time information to standard output, but this feature instead sends information to the log using the tracing crate.