pub struct TimeDelta(/* private fields */);Expand description
The difference between two TimeTicks.
Implementations§
Source§impl TimeDelta
impl TimeDelta
Sourcepub const fn from_days(h: i32) -> Self
pub const fn from_days(h: i32) -> Self
Constructs a TimeDelta that represents the given number of days.
Sourcepub const fn from_hours(h: i32) -> Self
pub const fn from_hours(h: i32) -> Self
Constructs a TimeDelta that represents the given number of hours.
Sourcepub const fn from_minutes(m: i32) -> Self
pub const fn from_minutes(m: i32) -> Self
Constructs a TimeDelta that represents the given number of minutes.
Sourcepub const fn from_seconds(s: i32) -> Self
pub const fn from_seconds(s: i32) -> Self
Constructs a TimeDelta that represents the given number of seconds.
Sourcepub const fn from_milliseconds(s: i32) -> Self
pub const fn from_milliseconds(s: i32) -> Self
Constructs a TimeDelta that represents the given number of milliseconds.
pub fn from_seconds_lossy(sec: f32) -> Self
pub fn total_whole_hours(&self) -> i32
pub fn total_whole_minutes(&self) -> i32
pub fn total_whole_seconds(&self) -> i32
pub fn total_whole_milliseconds(&self) -> i32
Sourcepub fn to_seconds(self) -> f32
pub fn to_seconds(self) -> f32
Returns the time delta represented as seconds.
Trait Implementations§
Source§impl Add<TimeDelta> for WallClockTime
impl Add<TimeDelta> for WallClockTime
Source§impl Ord for TimeDelta
impl Ord for TimeDelta
Source§impl PartialOrd for TimeDelta
impl PartialOrd for TimeDelta
Source§impl Sub<TimeDelta> for WallClockTime
impl Sub<TimeDelta> for WallClockTime
impl Copy for TimeDelta
impl Eq for TimeDelta
impl StructuralPartialEq for TimeDelta
Auto Trait Implementations§
impl Freeze for TimeDelta
impl RefUnwindSafe for TimeDelta
impl Send for TimeDelta
impl Sync for TimeDelta
impl Unpin for TimeDelta
impl UnwindSafe for TimeDelta
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