public class OperationTimer extends Object
You call the start() method to start timing and the end() method to end timing. You can then call the start() method again to time another event. You can also call start() repeatedly without calling end() - a start() method will always call end() for any previously started timings.
Call getEvents() to get an array of all the event names that were timed and getTimes() to get an array of the corresponding times. Call toString() to get a list of times for each event in seconds and ms.
Constructor and Description |
---|
OperationTimer() |
Modifier and Type | Method and Description |
---|---|
void |
end()
End timing an operation and add the timed name and value to the list of stored times.
|
String[] |
getEvents() |
long[] |
getTimes() |
void |
reset()
Clear all the current timed values.
|
void |
start(String operation)
Start timing an operation, ending any previous operation.
|
String |
toString()
Return a String representation of this object.
|
public void reset()
public void end()
public void start(String operation)
public String[] getEvents()
public long[] getTimes()