4 ms·
swift has TimeInterval which is a double and can hold an epoch offset. https://developer.apple.com/documentation/foundation/timeinterval https://developer.apple
by benmmurphy 3y ago
swift has TimeInterval which is a double and can hold an epoch offset. https://developer.apple.com/documentation/foundation/timeinterval https://developer.apple.com/documentation/foundation/timeint...
- happytoexplain 3y agoYes, but it's just a typealias intended to represent a span of time in APIs. As the docs say, "On its own, a time interval does not specify a unique point in time, or even a span between specific times."
- Someone 3y agoThat type wasn’t invented by the swift standard library writers; it’s a 1:1 copy of Objective-C’s NSTimeInterval (https://developer.apple.com/documentation/foundation/nstimeinterval https://developer.apple.com/documentation/foundation/nstimei...), so it’s not necessarily what a modern language designer would pick.