benchmarker
A simple and efficient benchmarking tool for Rust functions.
Features
- Easy-to-use macro for benchmarking functions
- Measures execution time and calculates statistics
- Supports multiple iterations for accurate results
- Customizable number of warmup rounds
Usage
Add this to your Cargo.toml:
[]
= "*"
Then, you can use the bench macro to benchmark your functions:
use benchmark;
use time;
use thread;
output:
Entering function: log_function
0
1
2
3
4
5
6
7
8
9
Exiting function: log_function
This will print the average time taken to execute the function and other statistics.
License
This project is licensed under the MIT License. See the LICENSE file for more details.