Created
July 3, 2019 04:02
-
-
Save ppth0608/edaf9d4e2b1932a72f98688a346805f5 to your computer and use it in GitHub Desktop.
How to convert TimeInterval to Milliseconds or Seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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