3 releases

0.1.2 Jan 6, 2023
0.1.1 Mar 24, 2020
0.1.0 Mar 24, 2020

#217 in Profiling

Download history 140/week @ 2024-07-26 140/week @ 2024-08-02 149/week @ 2024-08-09 153/week @ 2024-08-16 190/week @ 2024-08-23 153/week @ 2024-08-30 185/week @ 2024-09-06 183/week @ 2024-09-13 197/week @ 2024-09-20 191/week @ 2024-09-27 212/week @ 2024-10-04 183/week @ 2024-10-11 183/week @ 2024-10-18 211/week @ 2024-10-25 169/week @ 2024-11-01 134/week @ 2024-11-08

721 downloads per month
Used in 2 crates

MIT license

4KB
60 lines

scopetime

log runtime of arbitrary scope

This crate is part of the gitui project and can be used to annotate arbitrary scopes to trace their execution times via log:

in your crate:

[dependencies]
scopetime = "0.1"

in your code:

fn foo(){
    scope_time!("foo");

    // ... do something u wanna measure
}

the resulting log looks someting like this:

19:45:00 [TRACE] (7) scopetime: [scopetime/src/lib.rs:34] scopetime: 2 ms [my_crate::foo] @my_crate/src/bar.rs:5

lib.rs:

simple macro to insert a scope based runtime measure that logs the result

Dependencies

~86KB