prepare for publish sub crate scopetime

This commit is contained in:
Stephan Dilly 2020-03-24 20:57:37 +01:00
parent 3d0926d279
commit 07aa0d603f
3 changed files with 20 additions and 0 deletions

View file

@ -3,6 +3,9 @@ name = "scopetime"
version = "0.1.0"
authors = ["Stephan Dilly <dilly.stephan@gmail.com>"]
edition = "2018"
description = "log runtime of arbitrary scope"
homepage = "https://gitui.org"
license = "MIT"
[dependencies]
log = "0.4"

16
scopetime/README.md Normal file
View file

@ -0,0 +1,16 @@
# scopetime
*log runtime of arbitrary scope*
This crate is part of the [gitui](http://gitui.org) project and can be used to annotate arbitrary scopes to `trace` their execution times via `log`:
```rust
fn foo(){
scope_time!("foo");
}
```
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
```

View file

@ -1,3 +1,4 @@
#[deny(unsafe_code)]
use log::trace;
use std::time::Instant;