Crates.io | wd_sonyflake |
lib.rs | wd_sonyflake |
version | 0.0.1 |
source | src |
created_at | 2020-12-07 08:04:07.522136 |
updated_at | 2020-12-07 08:04:07.522136 |
description | unique id generator by sonyflake |
homepage | |
repository | |
max_upload_size | |
id | 320399 |
size | 14,717 |
|--0--|--timestamp--|--node_id--|--count--|
|-- 1 --|---- 41 -----|-- 10 --|--12 --|
use wd_sonyflake::SonyFlakeEntity;
fn main() {
let sfe = SonyFlakeEntity::new_default();
let start = std::time::Instant::now();
for i in 0..1000000{
let id = sfe.get_id();
// println!("生成一条id:{:x}",id)
}
println!("一百万条id需要:{:?}s", start.elapsed().as_secs());
}