Measures and emits the time interval between events received from an upstream publisher.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
Declaration
func measureInterval<S>(using scheduler: S, options: S.SchedulerOptions? = nil) -> Publishers.Measure Interval<Publishers.Concatenate<Prefix, Suffix>, S> where S : Scheduler
Parameters
scheduler
A scheduler to use for tracking the timing of events.
options
Options that customize the delivery of elements.
Return Value
A publisher that emits elements representing the time interval between the elements it receives.
Discussion
This operator uses the provided scheduler’s now
property to measure intervals between events.
The output type of the returned publisher is the time interval of the provided scheduler.