Package net.imglib2.util
Class BenchmarkHelper
java.lang.Object
net.imglib2.util.BenchmarkHelper
Tools for setting up basic benchmarks.
Call
benchmark(int, Runnable)
with the number of iterations and a
Runnable
to benchmark to obtain a list of run-times in milliseconds.- Author:
- Tobias Pietzsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRun a benchmark numRuns times and record the milliseconds taken for each run.static void
benchmarkAndPrint
(int numRuns, boolean printIndividualTimes, Runnable b) Run a benchmark numRuns times and print the results toSystem.out
.
-
Constructor Details
-
BenchmarkHelper
public BenchmarkHelper()
-
-
Method Details
-
benchmark
Run a benchmark numRuns times and record the milliseconds taken for each run.- Parameters:
numRuns
- how many times to run the benchmark.benchmark
- the benchmark.- Returns:
- run-times for each run (in milliseconds).
-
benchmarkAndPrint
Run a benchmark numRuns times and print the results toSystem.out
.- Parameters:
numRuns
- how many times to run the benchmark.printIndividualTimes
- whether to print the time for every individual run or just the median.b
- the benchmark.
-