Add computed properties: integerValue, doubleValue
This commit is contained in:
parent
60755e3cc4
commit
0f7f6ed275
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue