gitui/scopetime
2026-03-28 21:02:05 +01:00
..
src Fix all mismatched_lifetime_syntaxes warnings (#2727) 2025-10-28 16:34:42 +01:00
Cargo.toml use tombi for toml formatting (#2894) 2026-03-28 21:02:05 +01:00
LICENSE.md chore: Add LICENSE file into the sub-crates 2020-05-28 16:11:54 +02:00
README.md fix: fix typos (#2092) 2024-02-21 21:27:33 +01:00

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