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.
17 lines
371 B
Rust
17 lines
371 B
Rust
2 years ago
|
//! 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);
|
||
|
}
|