3 releases

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

#183 in Profiling

Download history 251/week @ 2024-01-13 263/week @ 2024-01-20 196/week @ 2024-01-27 189/week @ 2024-02-03 228/week @ 2024-02-10 395/week @ 2024-02-17 261/week @ 2024-02-24 209/week @ 2024-03-02 267/week @ 2024-03-09 269/week @ 2024-03-16 299/week @ 2024-03-23 248/week @ 2024-03-30 186/week @ 2024-04-06 242/week @ 2024-04-13 157/week @ 2024-04-20 146/week @ 2024-04-27

749 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