Expand description
Architecture-independent timer interface.
Provides the PlatformTimer trait for architecture-agnostic timer access
and free functions that delegate to the current platform’s implementation.
§Architecture implementations
- x86_64:
X86_64Timer– PIT-based tick counter and RDTSC timestamp. - AArch64: [
AArch64Timer] – Generic timer counter (CNTVCT_EL0 / CNTFRQ_EL0). - RISC-V: [
RiscVTimer] –rdtimeinstruction via SBI timer.
Structs§
Traits§
- Platform
Timer - Platform timer abstraction trait.
Functions§
- get_
ticks - Get current timer tick count (from the software tick counter maintained by each architecture’s interrupt handler).
- get_
timestamp_ ms - Get the current timestamp in milliseconds since boot.
- get_
timestamp_ secs - Get the current timestamp in seconds since boot.
- hw_
ticks_ per_ second - Return the hardware timer frequency in Hz.
- read_
hw_ timestamp - Read the hardware timestamp counter directly.
- set_
hw_ timer - Program the next timer interrupt.