 
   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.")

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

    return lastSampleTime / UInt64(numIters) / 1000
  }
}

/// Invoke the benchmark entry point and return the run time in milliseconds.
func runBench(_ test: BenchmarkInfo, _ c: TestConfig) -> BenchResults? {
  var samples = [UInt64](repeating: 0, count: c.numSamples)

  // Before we do anything, check that we actually have a function to
  // run. If we don't it is because the benchmark is not supported on

    return samples[index]
  }

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

