Skip to content

Commit dab530d

Browse files
ktopley-appledas
authored andcommitted
Adding documentation to clarify the result of DispatchTime(uptimeNanoseconds: 0)
(Radar 28814085) (SR-2807) Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent 96b5198 commit dab530d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/swift/Time.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public struct DispatchTime : Comparable {
3737
/// - uptimeNanoseconds: The number of nanoseconds since boot, excluding
3838
/// time the system spent asleep
3939
/// - Returns: A new `DispatchTime`
40+
/// - Discussion: This clock is the same as the value returned by
41+
/// `mach_absolute_time` when converted into nanoseconds.
42+
/// Note that `DispatchTime(uptimeNanoseconds: 0)` is
43+
/// equivalent to `DispatchTime.now()`, that is, its value
44+
/// represents the number of nanoseconds since boot (excluding
45+
/// system sleep time), not zero nanoseconds since boot.
4046
public init(uptimeNanoseconds: UInt64) {
4147
self.rawValue = dispatch_time_t(uptimeNanoseconds)
4248
}

0 commit comments

Comments
 (0)