Go to file
YOCKOW ffd3d7a4d1
Use GitHub Actions.
2020-05-22 14:18:46 +09:00
.github/workflows Use GitHub Actions. 2020-05-22 14:18:46 +09:00
Sources/TimeSpecification Refactor an initializer. 2020-05-22 14:14:38 +09:00
Tests Migrate to Swift5 & Change APIs. 2019-04-14 11:08:03 +09:00
.gitignore Use GitHub Actions. 2020-05-22 14:18:46 +09:00
LICENSE.txt Introduced Swift Package Manager and XCTest instead of swift-tap 2017-09-02 10:36:00 +09:00
Package.swift Migrate to Swift5 & Change APIs. 2019-04-14 11:08:03 +09:00
README.md Fix typo in README.md 2019-04-23 13:24:53 +09:00

README.md

What is SwiftTimeSpecification?

SwiftTimeSpecification is an implementation of struct timespec (struct mach_timespec on OS X) in Swift.
Its prototype is YOCKOW's Gist.

Sample Code

import TimeSpecification

func time(_ body:() -> Void) {
  let start = TimeSpecification(clock: .system)
  body()
  let end = TimeSpecification(clock: .system)
  let duration = end - start
  print("\(duration)")
}

Requirements

  • Swift 5 (including compatibility mode for 4, 4.2)
  • macOS or Linux

License

MIT License.
See "LICENSE.txt" for more information.