use std::time::Duration;
#[derive(Clone)]
pub struct SandClockConfig {
refresh_duration: Duration,
}
impl Default for SandClockConfig {
fn default() -> Self {
Self {
refresh_duration: Duration::from_millis(1000),
}
}
}
impl SandClockConfig {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn get_timer_loop_refreshing_duration(&self) -> Duration {
self.refresh_duration
}
#[must_use]
pub fn frequency(mut self, frequence_duration: Duration) -> Self {
self.refresh_duration = frequence_duration;
self
}
}