scopetime

Crates.ioscopetime
lib.rsscopetime
version0.1.2
sourcesrc
created_at2020-03-24 19:58:02.921182
updated_at2023-01-06 10:05:35.673422
descriptionlog runtime of arbitrary scope
homepagehttps://github.com/extrawurst/gitui
repositoryhttps://github.com/extrawurst/gitui
max_upload_size
id222410
size4,202
(extrawurst)

documentation

README

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
Commit count: 2293

cargo fmt