4 ms·
Swift is pretty good at this. e.g.: Task.sleep(nanoseconds: 3e11)
by windpower 5y ago
Swift is pretty good at this. e.g.:
Task.sleep(nanoseconds: 3e11)
- gh123man 5y agoIn swift I quite like DispatchTimeInterval's approach [1] (see Enumeration Cases). In most of my projects I end up adding a simple extension to TimeInterval to get the same behavior. Which makes reasoning about time very simple eg: Date().advanced(by: .hours(2) + .seconds(10)) I'm honestly not sure why TimeInterval doesn't include this representation by default. 1. https://developer.apple.com/documentation/dispatch/dispatchtimeinterval https://developer.apple.com/documentation/dispatch/dispatcht...