You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
369 B
Rust
16 lines
369 B
Rust
//! Traits for time management primitives.
|
|
|
|
use core::time::Duration;
|
|
|
|
pub trait TimeManager {
|
|
/// Return the clock frequency, meaning the resolution of the
|
|
/// time mesurement.
|
|
fn frequency(&self) -> u64;
|
|
|
|
/// The uptime since last power-on.
|
|
fn uptime(&self) -> Duration;
|
|
|
|
/// Sleep for the duration.
|
|
fn sleep(&self, duration: Duration);
|
|
}
|