hermes_runtime_components/traits/
time.rs

1use core::time::Duration;
2
3use cgp::prelude::*;
4
5#[derive_component(TimeComponent, ProvideTime<Runtime>)]
6pub trait HasTime: Async {
7    type Time: Async;
8
9    fn now(&self) -> Self::Time;
10
11    fn duration_since(current_time: &Self::Time, other_time: &Self::Time) -> Duration;
12}