controller/emgauwa-controller/src/relay_loop.rs

18 lines
432 B
Rust
Raw Normal View History

use std::time::Duration;
2023-11-29 13:27:46 +00:00
use chrono::Local;
use tokio::time;
use tokio::time::Instant;
2023-11-25 23:54:03 +00:00
2023-11-29 13:27:46 +00:00
use crate::settings::Settings;
2023-11-25 23:54:03 +00:00
#[allow(unused_variables)]
pub async fn run_relay_loop(settings: Settings) {
let default_duration = Duration::from_millis(1000);
loop {
let next_timestamp = Instant::now() + default_duration;
time::sleep_until(next_timestamp).await;
log::debug!("Relay loop: {}", Local::now().naive_local().time())
}
2023-11-27 11:49:40 +00:00
}