Make the tokio runtime optional

This commit is contained in:
Jonathan Kelley committed 2024-01-04 19:09:59 -08:00
1 parent 73d5069a20
commit 38216fa272
8 files changed
+60 -28

No files matched your search

+3 -2
View File
@@ -1,7 +1,8 @@
use dioxus::prelude::*;
use dioxus_signals::use_signal;
fn main() {
#[tokio::main]
async fn main() {
dioxus_desktop::launch(app);
}
@@ -10,7 +11,7 @@ fn app(cx: Scope) -> Element {
use_future!(cx, || async move {
loop {
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
count += 1;
println!("current: {count}");
}