Files
fal-swift/Sources/FalClient/TimeInterval+Extensions.swift
Daniel Rochetti 24f531005d feat: realtime binary protocol (#3)
* feat: initial high fps sample

* fix: remove prints

* feat: realtime turbo camera demo

* fix: fps count

* chore: docs and build update

* fix: remove non-exported targets

* feat: binary realtime protocol with msgpack

* fix: update macos support to v13

* chore: rename ObjectValue to Payload
2023-12-12 11:00:07 -08:00

25 lines
590 B
Swift

import Dispatch
extension DispatchTimeInterval {
public static func minutes(_ value: Int) -> DispatchTimeInterval {
.seconds(value * 60)
}
var milliseconds: Int {
switch self {
case let .milliseconds(value):
return value
case let .seconds(value):
return value * 1000
case let .microseconds(value):
return value / 1000
case let .nanoseconds(value):
return value / 1_000_000
case .never:
return 0
@unknown default:
return 0
}
}
}