EnumerationDispatch5.9.0
DispatchTimeInterval
Represents a time interval that can be used as an offset from a DispatchTime
or DispatchWallTime
.
enum DispatchTimeInterval
For example: let inOneSecond = DispatchTime.now() + DispatchTimeInterval.seconds(1)
If the requested time interval is larger then the internal representation permits, the result of adding it to a DispatchTime
or DispatchWallTime
is DispatchTime.distantFuture
and DispatchWallTime.distantFuture
respectively. Such time intervals compare as equal:
let t1 = DispatchTimeInterval.seconds(Int.max)
let t2 = DispatchTimeInterval.milliseconds(Int.max)
let result = t1 == t2 // true
Citizens in Dispatch
Conformances
protocol Equatable
A type that can be compared for value equality.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
case microseconds(Int)
case milliseconds(Int)
case nanoseconds(Int)
case never
case seconds(Int)
static func == (DispatchTimeInterval, DispatchTimeInterval
) -> Bool