3 releases
Uses new Rust 2024
new 0.1.2 | Apr 2, 2025 |
---|---|
0.1.1 | Mar 30, 2025 |
0.1.0 | Mar 30, 2025 |
#384 in Debugging
349 downloads per month
8KB
86 lines
timetrap
Description
timetrap
library is intended to wrap your code and measure the time of its execution.
Install it as:
cargo install timetrap
Time
Example of use:
use timetrap::*;
trap!("section A", {
let a = 0;
...
});
which results in:
section A took 14.834µs
Memeory
Also with help of sysinfo you can measure memory usage in the same manner.
Example of use:
use timetrap::*;
trap_mem!("make_plot()", MemUnits.Kb, {
let a = 0;
...
});
which results in:
make_plot() took 928.328083ms
make_plot() consumed memory: 560.00Kb
make_plot() consumed swap: 0.00Kb
Dependencies
~780KB
~18K SLoC