Lines Matching refs:now
13 ($now:expr, $ms:expr) => {{
14 let elapsed = $now.elapsed();
31 let now = Instant::now(); in immediate_sleep() localVariable
34 time::sleep_until(now).await; in immediate_sleep()
35 assert_elapsed!(now, 0); in immediate_sleep()
62 let now = Instant::now(); in delayed_sleep_level_0() localVariable
64 time::sleep_until(now + ms(i)).await; in delayed_sleep_level_0()
66 assert_elapsed!(now, i); in delayed_sleep_level_0()
75 let now = Instant::now(); in sub_ms_delayed_sleep() localVariable
76 let deadline = now + ms(1) + Duration::new(0, 1); in sub_ms_delayed_sleep()
80 assert_elapsed!(now, 1); in sub_ms_delayed_sleep()
90 let now = Instant::now(); in delayed_sleep_wrapping_level_0() localVariable
91 time::sleep_until(now + ms(60)).await; in delayed_sleep_wrapping_level_0()
93 assert_elapsed!(now, 60); in delayed_sleep_wrapping_level_0()
100 let now = Instant::now(); in reset_future_sleep_before_fire() localVariable
102 let mut sleep = task::spawn(Box::pin(time::sleep_until(now + ms(100)))); in reset_future_sleep_before_fire()
107 sleep.as_mut().reset(Instant::now() + ms(200)); in reset_future_sleep_before_fire()
110 assert_elapsed!(now, 200); in reset_future_sleep_before_fire()
117 let now = Instant::now(); in reset_past_sleep_before_turn() localVariable
119 let mut sleep = task::spawn(Box::pin(time::sleep_until(now + ms(100)))); in reset_past_sleep_before_turn()
124 sleep.as_mut().reset(now + ms(80)); in reset_past_sleep_before_turn()
127 assert_elapsed!(now, 80); in reset_past_sleep_before_turn()
134 let now = Instant::now(); in reset_past_sleep_before_fire() localVariable
136 let mut sleep = task::spawn(Box::pin(time::sleep_until(now + ms(100)))); in reset_past_sleep_before_fire()
143 sleep.as_mut().reset(now + ms(80)); in reset_past_sleep_before_fire()
146 assert_elapsed!(now, 80); in reset_past_sleep_before_fire()
153 let now = Instant::now(); in reset_future_sleep_after_fire() localVariable
154 let mut sleep = Box::pin(time::sleep_until(now + ms(100))); in reset_future_sleep_after_fire()
157 assert_elapsed!(now, 100); in reset_future_sleep_after_fire()
159 sleep.as_mut().reset(now + ms(110)); in reset_future_sleep_after_fire()
161 assert_elapsed!(now, 110); in reset_future_sleep_after_fire()
168 let now = Instant::now(); in reset_sleep_to_past() localVariable
170 let mut sleep = task::spawn(Box::pin(time::sleep_until(now + ms(100)))); in reset_sleep_to_past()
177 sleep.as_mut().reset(now + ms(40)); in reset_sleep_to_past()
188 let now = Instant::now(); in creating_sleep_outside_of_context() localVariable
192 let _fut = time::sleep_until(now + ms(500)); in creating_sleep_outside_of_context()
200 time::sleep_until(Instant::now() + ms(YR_5)).await; in greater_than_max()
225 let deadline = tokio::time::Instant::now() in multi_long_sleeps()
233 assert!(tokio::time::Instant::now() >= deadline); in multi_long_sleeps()
240 let deadline = tokio::time::Instant::now() in long_sleeps()
248 assert!(tokio::time::Instant::now() >= deadline); in long_sleeps()
249 assert!(tokio::time::Instant::now() <= deadline + Duration::from_millis(1)); in long_sleeps()
258 if let Some(deadline) = tokio::time::Instant::now().checked_add(Duration::from_secs(1u64 << 62)) in very_long_sleeps()
281 .reset(tokio::time::Instant::now() + std::time::Duration::from_secs(600)); in reset_after_firing()
318 let start = tokio::time::Instant::now(); in drop_after_reschedule_at_new_scheduled_time()