1
Fork 0
mirror of https://github.com/RGBCube/bonfire.v synced 2025-07-29 06:57:44 +00:00

Add examples

This commit is contained in:
RGBCube 2022-12-05 18:36:35 +03:00
parent a7faaf1085
commit aa4e89d066
3 changed files with 48 additions and 1 deletions

17
examples/time.v Normal file
View file

@ -0,0 +1,17 @@
module main
import os
import rgbcube.bonfire { Snowflake }
fn main() {
snowflake := Snowflake(os.args[1] or {
println('Usage: <id>')
exit(1)
})
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()}')
}