|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelix.graph.util.StopWatch
public class StopWatch
a better stopwatch : you don't need to stop it all the time.
here are valid sequences :
start stop get start
start get ... get stop
start get ... reset ... get stop
This stopwatch also has some additional logging facilities.
Constructor Summary | |
---|---|
StopWatch()
Constructor : default / use Logger.global as logger |
|
StopWatch(Logger logger)
Constructor : default / use Logger.global as logger |
Method Summary | |
---|---|
long |
get()
Express the "reading" on the stopwatch as a numeric type. |
void |
log()
log current value on Logger at INFO level |
void |
log(Level level,
String header)
log current value on Logger |
void |
log(String header)
log current value on Logger at INFO level |
void |
reset()
Reset the stopwatch, whatever its state |
void |
start()
Start the stopwatch - with reset same as start(true) |
void |
start(boolean reset)
Start the stopwatch. |
void |
stop()
Stop the stopwatch. |
String |
toString()
override: express the "reading" on the stopwatch as a String |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StopWatch()
public StopWatch(Logger logger)
Method Detail |
---|
public void start(boolean reset)
reset
- reset stopwatch
IllegalStateException
- if the stopwatch is already running or started for the
first time with reset==falsepublic void start()
start(true)
public void stop()
IllegalStateException
- if the stopwatch is not already running.public void reset()
public long get()
public String toString()
toString
in class Object
public void log(Level level, String header)
public void log(String header)
public void log()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |