➕ Use async-std to sleep asynchronously (previously done with tokio)
This commit is contained in:
@@ -4,6 +4,9 @@ mod infrastructure;
|
||||
mod ui;
|
||||
mod utils;
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use async_std::task;
|
||||
use dioxus::prelude::*;
|
||||
use tokio::time::{sleep, Duration};
|
||||
use tracing::{debug, Level};
|
||||
@@ -24,8 +27,8 @@ fn app() -> Element {
|
||||
// Dummy timer simulating the loading of the application
|
||||
let _: Coroutine<()> = use_coroutine(|_: UnboundedReceiver<_>| async move {
|
||||
debug!("Not ready");
|
||||
sleep(Duration::from_secs(3)).await;
|
||||
// sleep(Duration::from_secs(0)).await;
|
||||
task::sleep(Duration::from_secs(3)).await;
|
||||
// task::sleep(Duration::from_secs(0)).await;
|
||||
debug!("Ready");
|
||||
ready.set(true);
|
||||
});
|
||||
|
Reference in New Issue
Block a user