Home
last modified time | relevance | path

Searched refs:Instant (Results 1 – 25 of 266) sorted by relevance

1234567891011

/external/rust/crates/tokio/src/time/
Dinstant.rs34 pub struct Instant { struct
35 std: std::time::Instant, argument
38 impl Instant { impl
48 pub fn now() -> Instant { in now()
53 pub fn from_std(std: std::time::Instant) -> Instant { in from_std() argument
54 Instant { std } in from_std()
57 pub(crate) fn far_future() -> Instant { in far_future()
66 pub fn into_std(self) -> std::time::Instant { in into_std() argument
75 pub fn duration_since(&self, earlier: Instant) -> Duration { in duration_since()
96 pub fn checked_duration_since(&self, earlier: Instant) -> Option<Duration> { in checked_duration_since()
[all …]
Dclock.rs10 use crate::time::{Duration, Instant};
15 pub(crate) fn now() -> Instant {
16 Instant::from_std(std::time::Instant::now())
24 pub(crate) fn now(&self) -> Instant {
39 use crate::time::{Duration, Instant};
66 base: std::time::Instant,
69 unfrozen: Option<std::time::Instant>,
110 inner.unfrozen = Some(std::time::Instant::now());
142 pub(crate) fn now() -> Instant {
146 Instant::from_std(std::time::Instant::now())
[all …]
Dinterval.rs2 use crate::time::{sleep_until, Duration, Instant, Sleep};
70 interval_at(Instant::now(), period) in interval()
100 pub fn interval_at(start: Instant, period: Duration) -> Interval { in interval_at() argument
149 pub async fn tick(&mut self) -> Instant { in tick() argument
164 pub fn poll_tick(&mut self, cx: &mut Context<'_>) -> Poll<Instant> { in poll_tick() argument
/external/rust/crates/instant/src/
Dwasm.rs5 pub struct Instant(Duration); struct
7 impl Ord for Instant { implementation
13 impl Eq for Instant {} implementation
15 impl Instant { impl
18 Instant(duration_from_f64(now())) in now()
22 pub fn duration_since(&self, earlier: Instant) -> Duration { in duration_since()
39 pub fn checked_add(&self, duration: Duration) -> Option<Instant> { in checked_add() argument
40 self.0.checked_add(duration).map(Instant) in checked_add()
47 pub fn checked_sub(&self, duration: Duration) -> Option<Instant> { in checked_sub() argument
48 self.0.checked_sub(duration).map(Instant) in checked_sub()
[all …]
/external/rust/crates/quiche/src/recovery/
Ddelivery_rate.rs35 use std::time::Instant;
43 delivered_time: Option<Instant>,
45 recent_delivered_packet_sent_time: Option<Instant>,
53 pub fn on_packet_sent(&mut self, pkt: &mut Sent, now: Instant) { in on_packet_sent() argument
71 pub fn on_packet_acked(&mut self, pkt: &Sent, now: Instant) { in on_packet_acked() argument
160 prior_time: Option<Instant>,
197 time_sent: Instant::now(), in rate_check()
204 delivered_time: Instant::now(), in rate_check()
205 recent_delivered_packet_sent_time: Instant::now(), in rate_check()
212 .on_packet_sent(&mut pkt_1, Instant::now()); in rate_check()
[all …]
Dreno.rs32 use std::time::Instant;
48 pub fn on_packet_sent(r: &mut Recovery, sent_bytes: usize, _now: Instant) { in on_packet_sent() argument
53 r: &mut Recovery, packet: &Acked, epoch: packet::Epoch, now: Instant, in on_packet_acked() argument
102 r: &mut Recovery, time_sent: Instant, epoch: packet::Epoch, now: Instant, in congestion_event() argument
156 let now = Instant::now(); in reno_send()
170 let now = Instant::now(); in reno_slow_start()
182 delivered_time: std::time::Instant::now(), in reno_slow_start()
183 recent_delivered_packet_sent_time: std::time::Instant::now(), in reno_slow_start()
218 let now = Instant::now(); in reno_congestion_event()
232 let now = Instant::now(); in reno_congestion_avoidance()
Dmod.rs32 use std::time::Instant;
72 loss_detection_timer: Option<Instant>,
76 time_of_last_sent_ack_eliciting_pkt: [Option<Instant>; packet::EPOCH_COUNT],
94 loss_time: [Option<Instant>; packet::EPOCH_COUNT],
123 congestion_recovery_start_time: Option<Instant>,
198 handshake_status: HandshakeStatus, now: Instant, trace_id: &str, in on_packet_sent() argument
238 fn on_packet_sent_cc(&mut self, sent_bytes: usize, now: Instant) { in on_packet_sent_cc() argument
244 epoch: packet::Epoch, handshake_status: HandshakeStatus, now: Instant, in on_ack_received() argument
356 &mut self, handshake_status: HandshakeStatus, now: Instant, in on_loss_detection_timeout() argument
420 now: Instant, in on_pkt_num_space_discarded() argument
[all …]
/external/rust/crates/crossbeam-channel/src/flavors/
Dat.rs7 use std::time::{Duration, Instant};
15 pub type AtToken = Option<Instant>;
20 delivery_time: Instant,
29 pub fn new_deadline(when: Instant) -> Self { in new_deadline()
38 Self::new_deadline(Instant::now() + dur) in new_timeout()
43 pub fn try_recv(&self) -> Result<Instant, TryRecvError> { in try_recv() argument
50 if Instant::now() < self.delivery_time { in try_recv()
67 pub fn recv(&self, deadline: Option<Instant>) -> Result<Instant, RecvTimeoutError> { in recv() argument
77 let now = Instant::now(); in recv()
106 pub unsafe fn read(&self, token: &mut Token) -> Result<Instant, ()> { in read() argument
[all …]
Dtick.rs6 use std::time::{Duration, Instant};
15 pub type TickToken = Option<Instant>;
20 delivery_time: AtomicCell<Instant>,
31 delivery_time: AtomicCell::new(Instant::now() + dur), in new()
38 pub fn try_recv(&self) -> Result<Instant, TryRecvError> { in try_recv() argument
40 let now = Instant::now(); in try_recv()
59 pub fn recv(&self, deadline: Option<Instant>) -> Result<Instant, RecvTimeoutError> { in recv() argument
62 let now = Instant::now(); in recv()
88 pub unsafe fn read(&self, token: &mut Token) -> Result<Instant, ()> { in read() argument
95 Instant::now() < self.delivery_time.load() in is_empty()
[all …]
/external/rust/crates/tokio/src/time/driver/
Dsleep.rs2 use crate::time::{error::Error, Duration, Instant};
21 pub fn sleep_until(deadline: Instant) -> Sleep { in sleep_until()
61 match Instant::now().checked_add(duration) { in sleep()
63 None => sleep_until(Instant::far_future()), in sleep()
160 deadline: Instant,
169 pub(crate) fn new_timeout(deadline: Instant) -> Sleep { in new_timeout()
177 Self::new_timeout(Instant::far_future()) in far_future()
181 pub fn deadline(&self) -> Instant { in deadline() argument
219 pub fn reset(self: Pin<&mut Self>, deadline: Instant) { in reset() argument
/external/rust/crates/instant/
DREADME.md1 # Instant chapter
3 If you call `std::time::Instant::now()` on a WASM platform, it will panic. This crate provides a pa…
4 replacement for `std::time::Instant` that works on WASM too. This defines the type `instant::Instan…
6 * A struct emulating the behavior of **std::time::Instant** if you are targeting `wasm32-unknown-un…
8 * A type alias for `std::time::Instant` otherwise.
12 …** or **wasm-bindgen** feature is enabled, this crate will continue to rely on `std::time::Instant`
34 // Will be the same as `std::time::Instant`.
35 let now = instant::Instant::new();
53 // Will emulate `std::time::Instant` based on `performance.now()`.
54 let now = instant::Instant::new();
[all …]
/external/rust/crates/tokio/tests/
Dtime_sleep.rs9 use tokio::time::{self, Duration, Instant};
31 let now = Instant::now(); in immediate_sleep()
62 let now = Instant::now(); in delayed_sleep_level_0()
75 let now = Instant::now(); in sub_ms_delayed_sleep()
90 let now = Instant::now(); in delayed_sleep_wrapping_level_0()
100 let now = Instant::now(); in reset_future_sleep_before_fire()
107 sleep.as_mut().reset(Instant::now() + ms(200)); in reset_future_sleep_before_fire()
117 let now = Instant::now(); in reset_past_sleep_before_turn()
134 let now = Instant::now(); in reset_past_sleep_before_fire()
153 let now = Instant::now(); in reset_future_sleep_after_fire()
[all …]
Dtest_clock.rs4 use tokio::time::{self, Duration, Instant};
8 let start = Instant::now(); in resume_lets_time_move_forward_instead_of_resetting_it()
11 let advanced_by_ten_secs = Instant::now(); in resume_lets_time_move_forward_instead_of_resetting_it()
15 assert!(advanced_by_ten_secs < Instant::now()); in resume_lets_time_move_forward_instead_of_resetting_it()
16 assert!(Instant::now() - advanced_by_ten_secs < Duration::from_secs(1)); in resume_lets_time_move_forward_instead_of_resetting_it()
21 let start = Instant::now(); in can_pause_after_resume()
27 assert!(Instant::now() - start > Duration::from_secs(20)); in can_pause_after_resume()
28 assert!(Instant::now() - start < Duration::from_secs(21)); in can_pause_after_resume()
Dtime_rt.rs16 let when = Instant::now() + Duration::from_millis(100); in timer_with_threaded_runtime()
19 assert!(Instant::now() >= when); in timer_with_threaded_runtime()
35 let when = Instant::now() + Duration::from_millis(100); in timer_with_basic_scheduler()
38 assert!(Instant::now() >= when); in timer_with_basic_scheduler()
70 let when = Instant::now() + Duration::from_millis(20); in starving()
74 assert!(Instant::now() >= when); in starving()
83 let now = Instant::now(); in timeout_value()
88 assert!(Instant::now() >= now + dur); in timeout_value()
Dtime_timeout.rs5 use tokio::time::{self, timeout, timeout_at, Instant};
14 let mut fut = task::spawn(timeout_at(Instant::now(), async {})); in simultaneous_deadline_future_completion()
23 let mut fut = task::spawn(timeout_at(Instant::now() - ms(1000), async {})); in completed_future_past_deadline()
37 let mut fut = task::spawn(timeout_at(Instant::now() + ms(100), rx)); in future_and_deadline_in_future()
111 let mut fut = task::spawn(timeout_at(Instant::now(), pending::<()>())); in deadline_now_elapses()
125 let mut fut = task::spawn(timeout_at(Instant::now() + ms(300), pending::<()>())); in deadline_future_elapses()
/external/icu/android_icu4j/testing/src/com/android/i18n/test/timezone/
DZoneInfoDataTest.java35 import java.time.Instant;
71 Instant[] times = { in testMakeTimeZone_OneType_NoTransitions()
72 Instant.ofEpochMilli(Long.MIN_VALUE), in testMakeTimeZone_OneType_NoTransitions()
73 Instant.ofEpochMilli(0), in testMakeTimeZone_OneType_NoTransitions()
74 Instant.ofEpochMilli(Long.MAX_VALUE), in testMakeTimeZone_OneType_NoTransitions()
98 Instant[] times = { timeFromSeconds(-2), timeFromSeconds(0), timeFromSeconds(2) }; in testReadTimeZone_OneNonDstTransition()
143 Instant transitionTime = timeFromSeconds(-5); in testReadTimeZone_NegativeTransition()
146 Instant beforeTransitionTime = transitionTime.minusMillis(1); in testReadTimeZone_NegativeTransition()
155 Instant afterTransitionTime = transitionTime.plusMillis(1); in testReadTimeZone_NegativeTransition()
181 Instant transitionTime = timeFromSeconds(5); in testReadTimeZone_PositiveTransition()
[all …]
/external/rust/crates/instant/tests/
Dwasm.rs3 use instant::Instant;
12 let now = Instant::now(); in test_instant_now()
21 let now = Instant::now(); in test_duration()
32 let now = Instant::now(); in test_checked_add()
43 let now = Instant::now(); in test_checked_sub()
/external/rust/crates/parking_lot_core/src/thread_parker/
Dwasm_atomic.rs13 use instant::Instant;
26 fn checked_duration_since_now(other: Instant) -> Option<Duration> {
27 let now = Instant::now();
37 fn checked_duration_since_now(timeout: Instant) -> Option<Duration> {
38 timeout.checked_duration_since(Instant::now())
84 unsafe fn park_until(&self, timeout: Instant) -> bool { in park_until()
/external/rust/crates/quiche/src/
Dminmax.rs56 use std::time::Instant;
60 time: Instant,
72 time: Instant::now(), in new()
79 pub fn reset(&mut self, time: Instant, meas: T) -> T { in reset() argument
90 pub fn running_min(&mut self, win: Duration, time: Instant, meas: T) -> T { in running_min() argument
111 pub fn _running_max(&mut self, win: Duration, time: Instant, meas: T) -> T { in _running_max() argument
132 fn subwin_update(&mut self, win: Duration, time: Instant, meas: T) -> T { in subwin_update() argument
177 let now = Instant::now(); in reset_filter_rtt()
196 let now = Instant::now(); in reset_filter_bandwidth()
218 let mut time = Instant::now(); in get_windowed_min_rtt()
[all …]
/external/icu/android_icu4j/testing/src/com/android/icu/test/util/
DExtendedTimeZoneParameterizedTest.java40 import java.time.Instant;
88 Instant[] instants = new Instant[] { in testTransitionsNearInstants()
100 Instant.now() in testTransitionsNearInstants()
108 for (Instant instant : instants) { in testTransitionsNearInstants()
143 final Instant start = LocalDateTime.of(1900, Month.JANUARY, 1, 12, 0) in testAllTransitions()
147 final Instant end = LocalDateTime.of(2100, Month.DECEMBER, 31, 12, 0) in testAllTransitions()
153 Instant instant = start; in testAllTransitions()
240 Instant instant = Instant.ofEpochMilli(utcTimeInMillis); in assertSameOffset()
280 Instant.ofEpochMilli(icuTransition.getTime()), jtTransition.getInstant()); in assertEquivalent()
/external/caliper/caliper/src/main/java/com/google/caliper/json/
DInstantTypeAdapter.java23 import org.joda.time.Instant;
31 final class InstantTypeAdapter extends TypeAdapter<Instant> {
32 @Override public void write(JsonWriter out, Instant value) throws IOException { in write()
36 @Override public Instant read(JsonReader in) throws IOException { in read()
/external/rust/crates/syn/tests/repo/
Dprogress.rs2 use std::time::{Duration, Instant};
6 tick: Instant,
14 tick: Instant::now() + Duration::from_millis(2000), in new()
24 let now = Instant::now(); in read()
/external/rust/crates/bindgen/src/
Dtime.rs2 use std::time::{Duration, Instant};
9 start: Instant,
19 start: Instant::now(), in new()
32 Instant::now() - self.start in elapsed()
/external/caliper/caliper/src/main/java/com/google/caliper/model/
DRun.java25 import org.joda.time.Instant;
39 private Instant startTime;
61 public Instant startTime() { in startTime()
93 private Instant startTime;
104 public Builder startTime(Instant startTime) { in startTime()
/external/rust/crates/crossbeam-utils/src/sync/
Dparker.rs6 use std::time::{Duration, Instant};
124 self.park_deadline(Instant::now() + timeout) in park_timeout()
141 pub fn park_deadline(&self, deadline: Instant) { in park_deadline() argument
315 fn park(&self, deadline: Option<Instant>) { in park() argument
327 if deadline <= Instant::now() { in park()
356 let now = Instant::now(); in park()

1234567891011