2023-07-25 19:04:38 +00:00
|
|
|
use std::time::Instant;
|
|
|
|
|
2023-07-26 00:51:49 +00:00
|
|
|
use julid::Julid;
|
2023-07-25 19:04:38 +00:00
|
|
|
|
|
|
|
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!(
|
2023-07-27 21:00:26 +00:00
|
|
|
"{id}: created_at {}; counter: {}; sortable: {}",
|
|
|
|
id.created_at(),
|
2023-07-25 19:04:38 +00:00
|
|
|
id.counter(),
|
|
|
|
id.sortable()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
println!("2000 IDs generated in {dur}us");
|
|
|
|
}
|