1 | #![cfg(all(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 | } |
15 |