pretty-bytes-rust 0.2.1

Rust library that takes a number that represent a byte and returns a string that is prettier to read for a human
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use pretty_bytes_rust::pretty_bytes;

fn all_benchmarks(c: &mut Criterion) {
    c.bench_function("pretty_bytes with default options", |b| {
        b.iter(|| pretty_bytes(black_box(1), None))
    });
}
criterion_group!(
    name = benches;
    config = Criterion::default().sample_size(2000);
    targets = all_benchmarks
);
criterion_main!(benches);