Skip to content

Commit 787dd92

Browse files
authored
Merge pull request swiftlang#210 from ktopley-apple/dispatch-time-0-doc
Adding documentation to clarify the result of DispatchTime(uptimeNanoseconds: 0)
2 parents 10eb0e4 + 003a7b8 commit 787dd92

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)