mirror of
https://github.com/zhigang1992/fal-swift.git
synced 2026-01-12 22:47:17 +08:00
* 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
25 lines
590 B
Swift
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
|
|
}
|
|
}
|
|
}
|