pub struct PlatformTime;Expand description
A platform-independent timestamp in milliseconds.
On wasm32 this returns a stub value (0). For real browser timestamps,
use js_sys::Date::now() via the wasm-bindgen / js-sys crates.
On native targets this delegates to std::time::SystemTime.
Implementations§
Source§impl PlatformTime
impl PlatformTime
Sourcepub fn now_ms() -> u64
pub fn now_ms() -> u64
Returns current time in milliseconds since Unix epoch.
- On wasm32: returns
0(stub — production builds should usejs_sys::Date::now()). - On native: uses
std::time::SystemTime.
Auto Trait Implementations§
impl Freeze for PlatformTime
impl RefUnwindSafe for PlatformTime
impl Send for PlatformTime
impl Sync for PlatformTime
impl Unpin for PlatformTime
impl UnsafeUnpin for PlatformTime
impl UnwindSafe for PlatformTime
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more