org.javasimon.utils
Class BenchmarkUtils
java.lang.Object
org.javasimon.utils.BenchmarkUtils
public class BenchmarkUtils
- extends Object
Utility class for benchmark execution.
- Since:
- 3.1
- Author:
- virgo47@gmail.com
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MANAGER
private static final Manager MANAGER
BenchmarkUtils
public BenchmarkUtils()
run
public 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.
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.
- Parameters:
warmupRuns - number of runs before the measuring startsmeasuredRuns - number of measured runstasks - list of tasks to measure
- Returns:
- result of the measured runs as an array of stopwatch objects in the order of the tasks
warmup
private static void warmup(int warmupRuns,
BenchmarkUtils.Task[] tasks)
warmupTask
private static void warmupTask(BenchmarkUtils.Task task)
measure
private static void measure(int measuredRuns,
BenchmarkUtils.Task[] tasks)
presentSummary
private static void presentSummary(BenchmarkUtils.Task[] tasks)
Copyright © 2013. All Rights Reserved.