init(uptimeNanoseconds:)
Creates a DispatchTime
relative to the system clock that ticks since boot.
init(uptimeNanoseconds: UInt64)
Parameters
- uptimeNanoseconds
The number of nanoseconds since boot, excluding time the system spent asleep
Returns
A new DispatchTime
Discussion: This clock is the same as the value returned by
mach_absolute_time
when converted into nanoseconds. On some platforms, the nanosecond value is rounded up to a multiple of the Mach timebase, using the conversion factors returned bymach_timebase_info()
. The nanosecond equivalent of the rounded result can be obtained by reading theuptimeNanoseconds
property. Note thatDispatchTime(uptimeNanoseconds: 0)
is equivalent toDispatchTime.now()
, that is, its value represents the number of nanoseconds since boot (excluding system sleep time), not zero nanoseconds since boot.