| Crates.io | macrotime |
| lib.rs | macrotime |
| version | 2.1.0 |
| created_at | 2025-01-03 05:58:02.538362+00 |
| updated_at | 2025-09-01 23:20:39.362121+00 |
| description | A Rust crate for efficient timing. |
| homepage | https://github.com/gavincrawford/macrotime |
| repository | https://github.com/gavincrawford/macrotime |
| max_upload_size | |
| id | 1502154 |
| size | 6,893 |
This crate implements macros that can be used to time arbitrary snippets of code. This allows you to easily test functions on the go, without any fancy boilerplate for benchmarking.
To time a snippet of code, simply:
use macrotime::*;
dbg_time!("task", {
// write any code here...
});
And the execution time will be logged in the most relevant unit with the 'task' context added for readability. It's that simple.
If you'd like to see more examples or learn more about MacroTime, take a look at the documentation. All information listed there should be up to date and tested for the most recent version of the package.