SwiftTimeSpecification is an implementation of struct timespec
(struct mach_timespec
on OS X) in Swift.
Its prototype is YOCKOW's Gist.
import TimeSpecification
let duration = TimeSpecification.measure(repeatCount: 100) { doIt() }
print("It took \(duration) seconds.") // -> Processing time to execute `doIt` 100 times.
Date
import TimeSpecification
let now = TimeSpecification(clock: .calendar)
let dateNow = Date(timeIntervalSince1970: now) // -> Almost same with Date(timeIntervalSince1970: Double(time(nil)))
MIT License.
See "LICENSE.txt" for more information.
link |
Stars: 3 |
Last commit: 2 years ago |
Full Changelog: https://github.com/YOCKOW/SwiftTimeSpecification/compare/3.2.0...3.3.0
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics