futuresdr 0.0.40

An Experimental Async SDR Runtime for Heterogeneous Architectures.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::time::Duration;

/// Cross-target timer used by FutureSDR async code.
pub struct Timer;

impl Timer {
    /// Complete after `duration` has elapsed.
    pub async fn after(duration: Duration) {
        #[cfg(not(target_arch = "wasm32"))]
        async_io::Timer::after(duration).await;
        #[cfg(target_arch = "wasm32")]
        gloo_timers::future::sleep(duration).await;
    }
}