function compute(options) {
    options || (options = {});

    var async = options.async,
        bench = options.benchmark,
        elapsed = 0,
        queue = [],
        sample = [],
        initCount = bench.initCount;

    /**
     * Adds a number of clones to the queue.
     */
    function enqueue(count) {
      while (count--) {
        queue.push(bench.clone({
          '_host': bench,
          'events': { 'start': [update], 'cycle': [update] }
        }));
      }
    }

    /**
     * Updates the clone/host benchmarks to keep their data in sync.
     */
    function update(event) {
      var clone = this,
          cycles = clone.cycles,
          type = event.type;

      if (bench.running) {
        if (type == 'cycle') {
          if (clone.error) {
            bench.abort();
            bench.error = clone.error;
            bench.emit('error');
          }
          else {
            // Note: the host's bench.count prop is updated in `clock()`
            bench.hz = clone.hz;
            bench.initCount = clone.initCount;
            bench.times.period = clone.times.period;
            if (cycles > bench.cycles) {
              bench.cycles = cycles;
            }
          }
          bench.emit(type);
        }
        else {
          // reached in clone's onStart
          // Note: clone.minTime prop is inited in `clock()`
          clone.count = bench.initCount;
        }
      } else if (bench.aborted) {
        clone.abort();
      }
    }

    /**
     * Determines if more clones should be queued or if cycling should stop.
     */
    function evaluate(event, clone) {
      var mean,
          moe,
          rme,
          sd,
          sem,
          variance,
          now = +new Date,
          times = bench.times,
          done = bench.aborted,
          maxedOut = (elapsed += now - clone.times.timeStamp) / 1e3 > bench.maxTime,
          size = sample.push(clone.times.period),
          varOf = function(sum, x) { return sum + pow(x - mean, 2); };

      // exit early for aborted or unclockable tests
      if (done || clone.hz == Infinity) {
        maxedOut = !(size = sample.length = queue.length = 0);
      }
      // set host values
      if (!done) {
        // sample mean (estimate of the population mean)
        mean = getMean(sample);
        // sample variance (estimate of the population variance)
        variance = reduce(sample, varOf, 0) / (size - 1) || 0;
        // sample standard deviation (estimate of the population standard deviation)
        sd = sqrt(variance);
        // standard error of the mean (aka the standard deviation of the sampling distribution of the sample mean)
        sem = sd / sqrt(size);
        // margin of error
        moe = sem * getCriticalValue(size - 1);
        // relative margin of error
        rme = (moe / mean) * 100 || 0;

        extend(bench.stats, {
          'moe': moe,
          'rme': rme,
          'sem': sem,
          'deviation': sd,
          'mean': mean,
          'size': size,
          'variance': variance
        });

        // We exit early when the elapsed time exceeds the maximum time allowed
        // per benchmark. To prevent massive wait times, we do this even if the
        // minimum sample size has not been reached. We don't count cycle delays
        // toward the max time because delays may be increased by browsers that
        // clamp timeouts in inactive tabs.
        // https://developer.mozilla.org/en/window.setTimeout#Inactive_tabs
        if (maxedOut) {
          done = true;
          bench.running = false;
          bench.initCount = initCount;
          times.elapsed = (now - times.timeStamp) / 1e3;
        }
        if (bench.hz != Infinity) {
          times.period = mean;
          times.cycle = mean * bench.count;
          bench.hz = 1 / mean;
        }
      }
      // if time permits, increase sample size to reduce the margin of error
      if (queue.length < 2 && !maxedOut) {
        enqueue(1);
      }
      // stop the invoke cycle when done
      return !done;
    }

    // init queue and begin
    enqueue(bench.minSamples);
    invoke(queue, {
      'name': 'run',
      'args': { 'async': async },
      'queued': true,
      'onCycle': evaluate,
      'onComplete': function() {
        bench.emit('complete');
      }
    });
  }
Computes stats on benchmark results.
@private
@param {Object} options The options object.