|
Protomatter Software v1.1.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.protomatter.util.OpTimer
A benchmarking utility class. Basically encapsulates a name, start time and end time.
Usually used like this:
OpTimer timer = new OpTimer("Some long operation");
...
// a lot of junk
...
timer.stop();
Syslog.debug(this, timer);
This class can be used in conjunction with the
OpTimerUtil class, which can
parse log files for timer traces and produce
aggregate timing information.
OpTimerUtil, Serialized Form| Constructor Summary | |
OpTimer(java.lang.String name)
Create a new timer with the given name. |
|
OpTimer(java.lang.String name,
boolean showThread)
Create a new timer with the given name. |
|
| Method Summary | |
long |
elapsed()
Return elapsed time. |
java.lang.String |
getName()
Get the name of this timer. |
void |
setName(java.lang.String name)
Set the name of this timer. |
OpTimer |
start()
Re-start the timer. |
long |
startTime()
Get the start time of this timer. |
OpTimer |
stop()
Stop the timer. |
long |
stopTime()
Get the time this timer was stopped. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public OpTimer(java.lang.String name)
public OpTimer(java.lang.String name,
boolean showThread)
| Method Detail |
public OpTimer start()
public long elapsed()
public java.lang.String getName()
public void setName(java.lang.String name)
public long startTime()
public long stopTime()
public OpTimer stop()
public java.lang.String toString()
toString in class java.lang.Object
|
Protomatter Software v1.1.8 Copyright 1998-2002 Nate Sammons |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Protomatter Software v1.1.8 | http://protomatter.sourceforge.net/1.1.8 |