3 releases

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

#191 in Profiling

Download history 254/week @ 2024-03-14 303/week @ 2024-03-21 265/week @ 2024-03-28 195/week @ 2024-04-04 250/week @ 2024-04-11 154/week @ 2024-04-18 163/week @ 2024-04-25 172/week @ 2024-05-02 200/week @ 2024-05-09 277/week @ 2024-05-16 168/week @ 2024-05-23 222/week @ 2024-05-30 173/week @ 2024-06-06 158/week @ 2024-06-13 130/week @ 2024-06-20 95/week @ 2024-06-27

591 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

~87KB