|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.StopWatch
public class StopWatch
Measure the elapsed time.
Use this helper class if you want to measure elapsed time in some code fragment Example:
Field Summary | |
---|---|
private long |
startTime
|
private long |
stopTime
|
Constructor Summary | |
---|---|
StopWatch()
|
Method Summary | |
---|---|
long |
elapsed()
Return the elapsed milliseconds since creation or since the last restart(). |
static void |
main(java.lang.String[] args)
Only for testing. |
java.lang.String |
nice()
Returns a nice string with elapsed time. |
java.lang.String |
nice(boolean restart)
Returns a nice string with elapsed time. |
java.lang.String |
nice(long iterations)
Returns a nice string with elapsed time per iteration. |
void |
restart()
Reset and start the stop watch for a new measurement cycle. |
void |
stop()
Stop the watch |
java.lang.String |
toString()
Nicely formatted output containing elapsed time since Construction or since last restart(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private long startTime
private long stopTime
Constructor Detail |
---|
public StopWatch()
Method Detail |
---|
public final long elapsed()
public final void stop()
public final java.lang.String nice()
public final java.lang.String nice(long iterations)
public final java.lang.String nice(boolean restart)
restart
- true: Resets the stop watch.
public final java.lang.String toString()
toString
in class java.lang.Object
public final void restart()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |