public class StopWatch extends Object
TimeMeasurements for an Experiment.| Constructor and Description |
|---|
StopWatch(Experiment experiment)
Creates a new instance for the given
Experiment. |
| Modifier and Type | Method and Description |
|---|---|
Experiment |
getExperiment()
Get the
Experiment managed by this instance. |
TimeMeasurement |
getOrCreateRound(String id,
String... furtherIds)
Retrieves a
TimeMeasurement by its ID from rounds. |
TimeMeasurement |
start(String id,
String... furtherIds)
Starts a
TimeMeasurement. |
void |
stop(String id,
String... furtherIds)
Stops a
TimeMeasurement (if it exists). |
void |
stopAll()
Stops all
TimeMeasurements known to this instance. |
String |
toPrettyString()
Formats the
TimeMeasurements to something easily readable. |
String |
toPrettyString(String indent,
String bullet)
Formats the
TimeMeasurements to something easily readable. |
public StopWatch(Experiment experiment)
Experiment.experiment - that should be instrumentedpublic TimeMeasurement getOrCreateRound(String id, String... furtherIds)
TimeMeasurement by its ID from rounds. If it does not exist, it will be
created and also registered with the experiment.id - the ID of the TimeMeasurementfurtherIds - IDs of further nested TimeMeasurementsTimeMeasurementpublic TimeMeasurement start(String id, String... furtherIds)
TimeMeasurement. Any required parent TimeMeasurement will be started if necessary.id - ID of the root TimeMeasurementfurtherIds - IDs of further nested TimeMeasurementsTimeMeasurementpublic void stop(String id, String... furtherIds)
TimeMeasurement (if it exists).id - ID of the root TimeMeasurementfurtherIds - IDs of further nested TimeMeasurementspublic String toPrettyString()
TimeMeasurements to something easily readable.Stringpublic String toPrettyString(String indent, String bullet)
TimeMeasurements to something easily readable.indent - indent to be used when formatting sub-TimeMeasurementsbullet - bullet point characterStringpublic void stopAll()
TimeMeasurements known to this instance.public Experiment getExperiment()
Experiment managed by this instance.ExperimentCopyright © 2016. All rights reserved.