Skip to content
Snippets Groups Projects
Verified Commit 04f448bd authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

simplify the README

parent 1d745f40
Branches
Tags
No related merge requests found
......@@ -7,27 +7,9 @@ cargo add plnk --git https://gitlab.isae-supaero.fr/a.stevan/plnk --tag 0.2.0 #
```
## usage
```rust
use rand::Rng;
fn arithmetic(b: &plnk::Bencher) {
plnk::bench(b, "addition", || plnk::timeit(|| 1 + 2));
plnk::bench(b, "substraction", || plnk::timeit(|| 1 - 2));
plnk::bench(b, "multiplication", || plnk::timeit(|| 2 * 3));
}
fn random(b: &plnk::Bencher) {
let mut rng = rand::thread_rng();
plnk::bench(b, "sampling", || plnk::timeit(|| rng.gen::<u128>()));
}
fn main() {
const NB_MEASUREMENTS: usize = 10;
let bencher = plnk::Bencher::new(NB_MEASUREMENTS);
arithmetic(&bencher.with_name("arithmetic"));
random(&bencher.with_name("random"));
}
see the [arithmetic example](`examples/arithmetic.rs`) which can be used as
```shell
cargo run --release --example arithmetic -- --nb-measurements 1000
```
## the output of PLNK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment