|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.util.OperationTimer
This class can be used to time the operation of a sequence of events to millisecond precision (up to the resolution of the underlying os).
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 Summary | |
OperationTimer()
|
|
| Method Summary | |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Constructor Detail |
public OperationTimer()
| Method Detail |
public void reset()
public void end()
public void start(String operation)
public String[] getEvents()
public long[] getTimes()
public String toString()
Object
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||