Add computed properties: integerValue, doubleValue

This commit is contained in:
YOCKOW 2019-04-23 17:51:32 +09:00
parent 60755e3cc4
commit 0f7f6ed275
1 changed files with 8 additions and 0 deletions

View File

@ -90,6 +90,14 @@ extension TimeSpecification: ExpressibleByFloatLiteral {
}
}
extension TimeSpecification {
/// The value of seconds
public var integerValue: Int { return Int(self.seconds) }
/// Double representation of the time.
public var doubleValue: Double { return Double(self.nanoseconds) * 1.0E-9 + Double(self.seconds) }
}
// sum and difference
extension TimeSpecification {
public static func +(lhs:TimeSpecification, rhs:TimeSpecification) -> TimeSpecification {