     name.withCString { p in stopTrackingObjects(p) }
 #endif
 
-    return lastSampleTime / UInt64(numIters) / 1000
+    // Convert to μs and compute the average sample time per iteration.
+    return Int(lastSampleTime / 1000) / numIters
   }
 }
 
 /// 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)
+  var samples = [Int](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

import TestsUtils

struct BenchResults {
  typealias T = UInt64
  private let samples: [T]
  let maxRSS: Int
  let stats: Stats

    var variance: Double { return n < 2 ? 0.0 : S / Double(n - 1) }
    var standardDeviation: Double { return variance.squareRoot() }

    static func collect(_ s: inout Stats, _ x: Int){
        Stats.runningMeanVariance(&s, Double(x))
    }

