measure method

Future<double> measure()

Measures the score for the benchmark and returns it.

Implementation

Future<double> measure() async {
  await setup();
  try {
    // Warmup for at least 100ms. Discard result.
    await measureFor(warmup, 100);
    // Run the benchmark for at least 2000ms.
    return await measureFor(exercise, 2000);
  } finally {
    await teardown();
  }
}