Contents

measure(_:)

Measure the elapsed time to execute a closure.

Declaration

func measure(_ work: () throws -> Void) rethrows -> Self.Instant.Duration

Discussion

  let clock = ContinuousClock()
  let elapsed = clock.measure {
     someWork()
  }