 final class SampleRunner {
   let timer = Timer()
   let baseline = SampleRunner.getResourceUtilization()
+extension UInt64 {
+  var microseconds: Int { return Int(self / 1000) }
+}
+
   let c: TestConfig
   var start, end, lastYield: Timer.TimeT
   let schedulerQuantum = UInt64(10_000_000) // nanoseconds (== 10ms, macos)

    name.withCString { p in stopTrackingObjects(p) }
#endif

    // Convert to μs and compute the average sample time per iteration.
    return Int(lastSampleTime / 1000) / numIters
  }

  func logVerbose(_ msg: @autoclosure () -> String) {

    if (spent + nextSampleEstimate < schedulerQuantum) {
        start = timer.getTime()
    } else {
        logVerbose("    Yielding after ~\(spent.microseconds) μs")
        let now = yield()
        (start, lastYield) = (now, now)
    }
