garage44.eu/jeroen/pinnacle

logclone: git clone https://garage44.eu/jeroen/pinnacle.git

.. /ports/tokio-1.53.1/tests/rt_time_start_paused.rs

raw

#![cfg(feature = "full")]

use tokio::time::{Duration, Instant};

#[tokio::test(start_paused = true)]
async fn test_start_paused() {
    let now = Instant::now();

    // Pause a few times w/ std sleep and ensure `now` stays the same
    for _ in 0..5 {
        std::thread::sleep(Duration::from_millis(1));
        assert_eq!(now, Instant::now());
    }
}