Working Diag & artnet proto with imported led driver smi lib C
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "rust_sandbox"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.45.1", features = ["full"] }
|
||||
@@ -0,0 +1,28 @@
|
||||
use tokio::{
|
||||
spawn,
|
||||
time::{Duration, sleep},
|
||||
};
|
||||
|
||||
async fn say_hello() {
|
||||
// Wait for a while before printing to make it a more interesting race.
|
||||
sleep(Duration::from_millis(100)).await;
|
||||
print!("hello ");
|
||||
}
|
||||
|
||||
async fn say_world() {
|
||||
sleep(Duration::from_millis(100)).await;
|
||||
print!("world ");
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
loop {
|
||||
let handle1 = spawn(say_hello());
|
||||
let handle2 = spawn(say_world());
|
||||
|
||||
let _ = handle1.await;
|
||||
let _ = handle2.await;
|
||||
|
||||
println!("!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user