Skip to main content

ic_testkit/pic/
time.rs

1use pocket_ic::PocketIc;
2
3/// Focused time conversions missing from PocketIC's native API.
4pub trait PocketIcTimeExt {
5    /// Read PocketIC wall-clock time as nanoseconds since the Unix epoch.
6    fn current_time_nanos(&self) -> u64;
7}
8
9impl PocketIcTimeExt for PocketIc {
10    fn current_time_nanos(&self) -> u64 {
11        self.get_time().as_nanos_since_unix_epoch()
12    }
13}