Rust: Document scope in favor of begin/end.

This commit is contained in:
siedentop 2020-06-09 20:55:56 -07:00 committed by GitHub
parent 96b45326ad
commit 86fc9b13c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,14 +43,12 @@ If you'd like to profile the latency of an operation you can instead use:
```rust
// Boy I wish this function executed more quickly...
fn foo() {
coz::begin!("foo");
// ...
coz::end!("foo");
coz::scope!("foo");
}
```
Instead of `scope!` you may also use `coz::begin!("foo"); ... coz::end!("foo");`.
After you've instrumented your code, you need to also ensure that you're
compiling with DWARF debug information. To do this you'll want to configure
`Cargo.toml` again: