public abstract static class BenchmarkUtils.Task extends Object implements Runnable
perform()
method with benchmarked block of code.
Calling run()
executes the code and measures statistics using the stopwatch named in the
constructor. Calling perform()
executes the code without the stopwatch being used.
It is not recommended to implement too short Task repeated for many runs (thousands or millions)
but rather to impelement loop in the task to measure short operations and run the Task for units
of times (tens, hundreds). Otherwise Simon overhead (mostly System.nanoTime()
call) may
distort the results. If the measured operation is extremely short even the for loop can distort the results.Modifier | Constructor and Description |
---|---|
protected |
BenchmarkUtils.Task(String stopwatchName)
Protected constructor intended for extension.
|
protected BenchmarkUtils.Task(String stopwatchName)
stopwatchName
- name of the stopwatch (measuring name)Copyright © 2019. All rights reserved.