#[repr(transparent)]pub struct DispatchTime(pub u64);Expand description
An abstract representation of time.
Tuple Fields§
§0: u64Implementations§
Source§impl DispatchTime
impl DispatchTime
Sourcepub fn time(self: DispatchTime, delta: i64) -> DispatchTime
pub fn time(self: DispatchTime, delta: i64) -> DispatchTime
Create a dispatch_time_t relative to the current value of the default or wall time clock, or modify an existing dispatch_time_t.
On Apple platforms, the default clock is based on mach_absolute_time().
Parameter when: An optional dispatch_time_t to add nanoseconds to. If DISPATCH_TIME_NOW is
passed, then dispatch_time() will use the default clock (which is based on
mach_absolute_time() on Apple platforms). If DISPATCH_WALLTIME_NOW is used,
dispatch_time() will use the value returned by gettimeofday(3).
dispatch_time(DISPATCH_WALLTIME_NOW, delta) is equivalent to
dispatch_walltime(NULL, delta).
Parameter delta: Nanoseconds to add.
Returns: A new dispatch_time_t.
Sourcepub unsafe fn walltime(when: *const timespec, delta: i64) -> DispatchTime
pub unsafe fn walltime(when: *const timespec, delta: i64) -> DispatchTime
Create a dispatch_time_t using the wall clock.
On Mac OS X the wall clock is based on gettimeofday(3).
Parameter when: A struct timespec to add time to. If NULL is passed, then
dispatch_walltime() will use the result of gettimeofday(3).
dispatch_walltime(NULL, delta) returns the same value as
dispatch_time(DISPATCH_WALLTIME_NOW, delta).
Parameter delta: Nanoseconds to add.
Returns: A new dispatch_time_t.
Source§impl DispatchTime
impl DispatchTime
Trait Implementations§
Source§impl Clone for DispatchTime
impl Clone for DispatchTime
Source§fn clone(&self) -> DispatchTime
fn clone(&self) -> DispatchTime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more