public class BenchmarkUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BenchmarkUtils.Task
Helper object that requires implementing the
BenchmarkUtils.Task.perform() method with benchmarked block of code. |
| Constructor and Description |
|---|
BenchmarkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static StopwatchSample[] |
run(int warmupRuns,
int measuredRuns,
BenchmarkUtils.Task... tasks)
Runs the list of tasks to be benchmarked and returns
StopwatchSample array with measured results. |
public BenchmarkUtils()
public static StopwatchSample[] run(int warmupRuns, int measuredRuns, BenchmarkUtils.Task... tasks)
StopwatchSample array with measured results.
Number of warmup runs (without measuring) and measured runs must be specified.
BenchmarkUtils.Task provides the name of the Stopwatch that will store results.
Tasks should not be extremely short - see BenchmarkUtils.Task javadoc for more.warmupRuns - number of runs before the measuring startsmeasuredRuns - number of measured runstasks - list of tasks to measureCopyright © 2019. All rights reserved.