Debian Codegraph @

third_party/rust/tokio/tests/rt_time_start_paused.rs

raw
1 #![cfg(feature = "full")]
2
3 use tokio::time::{Duration, Instant};
4
5 #[tokio::test(start_paused = true)]
6 async fn test_start_paused() {
7 let now = Instant::now();
8
9 // Pause a few times w/ std sleep and ensure `now` stays the same
10 for _ in 0..5 {
11 std::thread::sleep(Duration::from_millis(1));
12 assert_eq!(now, Instant::now());
13 }
14 }