Skip to content

Instantly share code, notes, and snippets.

@ppth0608
Created July 3, 2019 04:02
Show Gist options
  • Save ppth0608/edaf9d4e2b1932a72f98688a346805f5 to your computer and use it in GitHub Desktop.
Save ppth0608/edaf9d4e2b1932a72f98688a346805f5 to your computer and use it in GitHub Desktop.
How to convert TimeInterval to Milliseconds or Seconds
import Foundation
extension TimeInterval {
var seconds: Int {
return Int(self.rounded())
}
var milliseconds: Int {
return Int(self * 1_000)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment