public class BenchmarkHelper extends Object
benchmark(int, Runnable)
with the number of iterations and a
Runnable
to benchmark to obtain a list of run-times in milliseconds.Constructor and Description |
---|
BenchmarkHelper() |
Modifier and Type | Method and Description |
---|---|
static ArrayList<Long> |
benchmark(int numRuns,
Runnable benchmark)
Run 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 to
System.out
. |
public static ArrayList<Long> benchmark(int numRuns, Runnable benchmark)
numRuns
- how many times to run the benchmark.benchmark
- the benchmark.public static void benchmarkAndPrint(int numRuns, boolean printIndividualTimes, Runnable b)
System.out
.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.Copyright © 2015–2022 ImgLib2. All rights reserved.