julid-rs/examples/benchmark.rs
Joe Ardent b799a9955f Prepare for new release.
Adds copious docs and reorganizes the code a little bit. Ready for final release, hopefully.
2023-07-27 14:00:26 -07:00

23 lines
513 B
Rust

use std::time::Instant;
use julid::Julid;
fn main() {
let mut v = Vec::with_capacity(2000);
let start = Instant::now();
for _ in 0..2000 {
v.push(Julid::new());
}
let end = Instant::now();
let dur = (end - start).as_micros();
for id in v.iter() {
println!(
"{id}: created_at {}; counter: {}; sortable: {}",
id.created_at(),
id.counter(),
id.sortable()
);
}
println!("2000 IDs generated in {dur}us");
}