 
   for s in 0..<c.numSamples {
     var scale : Int
-    var elapsed_time : UInt64 = 0
+    var elapsed_time : Int = 0
     if c.fixedNumIters == 0 {
       elapsed_time = sampler.measure(test.name, fn: testFn, numIters: 1)
 
       if elapsed_time > 0 {
         let usPerSecond = 1_000_000.0 // microseconds (μs)
-        let timePerSample = UInt64(c.sampleTime * usPerSecond)
+        let timePerSample = Int(c.sampleTime * usPerSecond)
         /// Number of iterations to make `testFn` run for the desired time.
-        scale = Int(timePerSample / elapsed_time)
+        scale = timePerSample / elapsed_time
       } else {
         if c.verbose {
           print("    Warning: elapsed time is 0. This can be safely ignored if the body is empty.")

    return samples[index]
  }

  var sampleCount: T { return UInt64(samples.count) }
  var min: T { return samples.first! }
  var max: T { return samples.last! }
  var mean: T { return UInt64(stats.mean.rounded()) }
  var sd: T { return UInt64(stats.standardDeviation.rounded()) }
  var median: T { return self[0.5] }
}


  }

  /// Measure the `fn` and return the average sample time per iteration (μs).
  func measure(_ name: String, fn: (Int) -> Void, numIters: Int) -> Int {
#if SWIFT_RUNTIME_ENABLE_LEAK_CHECKER
    name.withCString { p in startTrackingObjects(p) }
#endif
