From 003a7b8583d34d5c0e0e03b87208b7e0b283dd91 Mon Sep 17 00:00:00 2001 From: Kim Topley Date: Wed, 8 Feb 2017 13:55:08 -0800 Subject: [PATCH] Adding documentation to clarify the result of DispatchTime(uptimeNanoseconds: 0) (Radar 28814085) (SR-2807) --- src/swift/Time.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/swift/Time.swift b/src/swift/Time.swift index 46a71d6f8..af31f6c12 100644 --- a/src/swift/Time.swift +++ b/src/swift/Time.swift @@ -37,6 +37,12 @@ public struct DispatchTime : Comparable { /// - 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. + /// Note that `DispatchTime(uptimeNanoseconds: 0)` is + /// equivalent to `DispatchTime.now()`, that is, its value + /// represents the number of nanoseconds since boot (excluding + /// system sleep time), not zero nanoseconds since boot. public init(uptimeNanoseconds: UInt64) { self.rawValue = dispatch_time_t(uptimeNanoseconds) }