datex_core/utils/time.rs
1use crate::runtime::global_context::get_global_context;
2use core::marker::Sync;
3use core::prelude::rust_2024::*;
4
5pub trait TimeTrait: Send + Sync {
6 /// Returns the current time in milliseconds since the Unix epoch.
7 fn now(&self) -> u64;
8}
9pub struct Time;
10impl Time {
11 pub fn now() -> u64 {
12 get_global_context().time.now()
13 }
14}