Structure

DispatchTime

A point in time relative to the default clock, with nanosecond precision.

Declaration

struct DispatchTime

Overview

On Apple platforms, the default clock is based on the Mach absolute time unit.

Topics

Getting Well-Known Times

static func now() -> DispatchTime

Returns the current time.

static let distantFuture: DispatchTime

A time in the distant future.

Creating a Dispatch Time Object

init(uptimeNanoseconds: UInt64)

Creates a time relative to the amount of time the system has been running.

Getting the Time

let rawValue: dispatch_time_t

Returns the underlying time value.

var uptimeNanoseconds: UInt64

Returns the number of nanoseconds since boot, excluding any time the system spent asleep.

Operator Functions

static func != (DispatchTime, DispatchTime) -> Bool

Returns a Boolean value indicating whether two values are not equal.

static func ... (DispatchTime) -> PartialRangeFrom<DispatchTime>

Returns a partial range extending upward from a lower bound.

static func ... (DispatchTime) -> PartialRangeThrough<DispatchTime>

Returns a partial range up to, and including, its upper bound.

static func ... (DispatchTime, DispatchTime) -> ClosedRange<DispatchTime>

Returns a closed range that contains both of its bounds.

static func ..< (DispatchTime) -> PartialRangeUpTo<DispatchTime>

Returns a partial range up to, but not including, its upper bound.

static func ..< (DispatchTime, DispatchTime) -> Range<DispatchTime>

Returns a half-open range that contains its lower bound but not its upper bound.

static func <= (DispatchTime, DispatchTime) -> Bool

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

static func > (DispatchTime, DispatchTime) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

static func >= (DispatchTime, DispatchTime) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

Relationships

Conforms To

See Also

Time Constructs

struct DispatchWallTime

An absolute point in time according to the wall clock, with microsecond precision.

enum DispatchTimeInterval

A number of seconds, millisconds, microseconds, or nanoseconds.

enum DispatchTimeoutResult

A result value indicating whether a dispatch operation finished before a specified time.

typealias dispatch_time_t

An abstract representation of time.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software