ic-auth-client 0.4.0-alpha

A client library for Internet Computer identity authentication services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::time::Duration;

#[cfg(target_family = "wasm")]
use wasm_timer::Delay;
#[cfg(not(target_family = "wasm"))]
use std::thread::sleep as std_sleep;

/// Sleep for the given number of milliseconds
pub async fn sleep(ms: u64) {
    #[cfg(target_family = "wasm")]
    {
        Delay::new(Duration::from_millis(ms)).await.unwrap();
    }
    #[cfg(not(target_family = "wasm"))]
    {
        std_sleep(Duration::from_millis(ms));
    }
}