3 releases

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

#12 in #command-line-interface

Download history 180/week @ 2023-02-08 195/week @ 2023-02-15 888/week @ 2023-02-22 389/week @ 2023-03-01 351/week @ 2023-03-08 299/week @ 2023-03-15 285/week @ 2023-03-22 202/week @ 2023-03-29 330/week @ 2023-04-05 220/week @ 2023-04-12 226/week @ 2023-04-19 269/week @ 2023-04-26 251/week @ 2023-05-03 200/week @ 2023-05-10 211/week @ 2023-05-17 227/week @ 2023-05-24

928 downloads per month
Used in 3 crates

MIT license

3KB
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

~78KB