Created
January 3, 2021 15:45
-
-
Save DanielCardonaRojas/0d2aabe89c8ab243ef514a548ce5efc5 to your computer and use it in GitHub Desktop.
TimeInterval Extensions
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
extension TimeInterval { | |
var milliseconds: Int { | |
return Int((truncatingRemainder(dividingBy: 1)) * 1000) | |
} | |
var seconds: Int { | |
return Int(self) % 60 | |
} | |
var minutes: Int { | |
return (Int(self) / 60 ) % 60 | |
} | |
var hours: Int { | |
return Int(self) / 3600 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment