TimeCapture
@ExperimentalBenchmarkConfigApi
public final class TimeCapture extends MetricCapture
Time metric, which reports time in nanos, based on the time passed to captureStop.
Reports elapsed time with the label from name, which defaults to timeNs.
Summary
Public constructors |
|---|
TimeCapture(@NonNull String name) |
Public methods |
|
|---|---|
void |
Pause data collection. |
void |
Resume data collection |
void |
captureStart(long timeNs)Starts collecting data for a run. |
void |
captureStop(long timeNs, @NonNull long[] output, int offset)Mark the end of a run, and store offset metrics in the output array, per sub metric. |
Inherited methods |
|---|
Public constructors
Public methods
captureStart
public void captureStart(long timeNs)
Starts collecting data for a run.
Called at the start of each run.
| Parameters | |
|---|---|
long timeNs |
Current time, just before starting metrics. Can be used directly to drive a timing metric produced. |
captureStop
public void captureStop(long timeNs, @NonNull long[] output, int offset)
Mark the end of a run, and store offset metrics in the output array, per sub metric.
To output values, store them in the output array offset by both the parameter offset, and their submetric index.
| Parameters | |
|---|---|
long timeNs |
Time of metric capture start, in monotonic time ( |
@NonNull long[] output |
LongArray sized to hold all simultaneous sub metric outputs, use |
int offset |
Offset into the output array to start writing sub metrics. |