1
Fork 0
mirror of https://github.com/RGBCube/bonfire.v synced 2025-07-28 14:37:44 +00:00
bonfire.v/examples/snowflake.v
2022-12-05 22:13:52 +03:00

17 lines
413 B
V

module main
import os
import rgbcube.bonfire { Snowflake }
fn main() {
snowflake := Snowflake(os.args[1] or {
println('Usage: <id>')
exit(1)
}.i64())
println('Snowflake: ${snowflake}')
println('- Created at: ${snowflake.created_at()}')
println('- Worker ID: ${snowflake.worker_id()}')
println('- Process ID: ${snowflake.process_id()}')
println('- Sequence number: ${snowflake.sequence_number()}')
}