File: README.md

package info (click to toggle)
rust-scopetime 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 88 kB
  • sloc: makefile: 4
file content (25 lines) | stat: -rw-r--r-- 523 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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`:

in your crate:
```
[dependencies]
scopetime = "0.1"
```

in your code:
```rust
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
```