pub struct Timestamp(/* private fields */);Expand description
Monotonic timestamp in nanoseconds since engine creation.
Uses monotonic time internally — immune to NTP drift, daylight saving, and clock rewinds.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn as_secs_f64(&self) -> f64
pub fn as_secs_f64(&self) -> f64
Returns the timestamp value in seconds (f64).
Sourcepub fn duration_since(&self, other: Timestamp) -> u64
pub fn duration_since(&self, other: Timestamp) -> u64
Duration since another timestamp in nanoseconds.
Returns 0 if other is after self.
Sourcepub fn add_millis(&self, millis: u64) -> Timestamp
pub fn add_millis(&self, millis: u64) -> Timestamp
Add milliseconds to this timestamp.
Trait Implementations§
Source§impl Ord for Timestamp
impl Ord for Timestamp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl Copy for Timestamp
impl Eq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations§
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