1
0
mirror of https://github.com/pcvolkmer/checkbar.git synced 2025-04-19 11:06:50 +00:00

Use tokio::time::sleep

This commit is contained in:
Paul-Christian Volkmer 2023-10-19 10:25:34 +02:00
parent 9858f6f7b6
commit 01bc8e7ade
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2022 Paul-Christian Volkmer Copyright (c) 2023 Paul-Christian Volkmer
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,7 @@
use checkbar::{get_click_cmd, print_states, read_click_event, run_click_cmd, Config, MouseButton}; use checkbar::{get_click_cmd, print_states, read_click_event, run_click_cmd, Config, MouseButton};
use serde_json::json; use serde_json::json;
use tokio::task; use tokio::task;
use tokio::time::sleep;
#[tokio::main(flavor = "multi_thread", worker_threads = 2)] #[tokio::main(flavor = "multi_thread", worker_threads = 2)]
async fn main() { async fn main() {
@ -31,7 +32,7 @@ async fn main() {
loop { loop {
let config = Config::read(); let config = Config::read();
print_states(&config.checks).await; print_states(&config.checks).await;
std::thread::sleep(config.interval); let _ = sleep(config.interval).await;
} }
}); });