In general, `time` does not have to be the average - it could also be a median or something other aggregate value. For this reason, if the complete set of measurements is available, we should do:

    def stdev = {
      val avg = complete.sum / complete.length
      complete.map(_ - avg).map(x => x * x).sum / (complete.length - 1)
    }

Also, the standard deviation is the square root of this. This value is actually called the "variance". We could add both as far as I'm concerned.