     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: UInt64){
+    static func collect(_ s: inout Stats, _ x: Int){
         Stats.runningMeanVariance(&s, Double(x))
     }
 

    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] }
}



  for s in 0..<c.numSamples {
    var scale : Int
    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 = Int(c.sampleTime * usPerSecond)
        /// Number of iterations to make `testFn` run for the desired 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.")
