tokio/runtime/metrics/
schedule_latency_mock.rs1use std::time::Instant;
6
7#[derive(Copy, Clone)]
8pub(crate) struct ScheduleLatencyInstant();
9
10impl ScheduleLatencyInstant {
11 pub(crate) fn new(_runtime_start: Option<Instant>) -> Self {
12 Self()
13 }
14
15 pub(crate) fn prepare(self, _runtime_start: Option<Instant>) -> Option<ScheduleLatencyContext> {
16 None
17 }
18}
19
20pub(crate) struct ScheduleLatencyContext {
21 _private: (),
22}
23
24impl ScheduleLatencyContext {
25 #[allow(dead_code)]
28 pub(crate) fn elapsed_nanos(&self, _now: Instant) -> u64 {
29 unimplemented!("This should never be called because prepare() always returns None")
30 }
31}