CombineSchedulers Documentation

Function measure(_:​)

public func measure(_ work: () throws -> Void) rethrows -> SchedulerTimeType.Stride  

Measure the elapsed time to execute a closure.

let elapsed = scheduler.measure {
  someWork()
}

Parameters

work () throws -> Void

A closure to execute.

Returns

The amount of time it took to execute the closure.