#logging

gnostr-scopetime

log runtime of arbitrary scope

2 stable releases

new 1906.925289.572444 Nov 26, 2025
1905.926180.332424 Dec 2, 2025

#174 in Profiling


Used in gnostr-asyncgit

MIT license

4KB
59 lines

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


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 something 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

Dependencies

~99KB