Expand description
High-resolution timer management for VeridianOS.
This module provides a software timer wheel that sits above the
architecture-specific hardware timer layer (crate::arch::timer).
It supports both one-shot and periodic timers with millisecond
granularity, using a hierarchical timer wheel with 256 slots for
efficient O(1) insertion and expiration.
§Usage
ⓘ
// Initialize the timer subsystem (called once during boot)
timer::init()?;
// Create a one-shot timer that fires after 100ms
let id = timer::create_timer(TimerMode::OneShot, 100, my_callback)?;
// Cancel a timer
timer::cancel_timer(id)?;
// Called from the timer interrupt handler
timer::timer_tick(elapsed_ms);
// Query monotonic uptime
let uptime = timer::get_uptime_ms();