use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rsbase62; use base62; fn benchmark_rsbase62(c: &mut Criterion) { let num: u128 = 0x123456789ABCDEF0123456789ABCDEF0; c.bench_function("rsbase62 encode", |b| b.iter(|| unsafe { rsbase62::encode(black_box(num)) })); } fn benchmark_base62_crate(c: &mut Criterion) { let num: u128 = 0x123456789ABCDEF0123456789ABCDEF0; c.bench_function("base62 crate encode", |b| b.iter(|| { base62::encode(black_box(num)) })); } criterion_group!(benches, benchmark_rsbase62, benchmark_base62_crate); criterion_main!(benches);