|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.jonclark.stat.SecondTimer
public class SecondTimer
| Constructor Summary | |
|---|---|
SecondTimer()
Does not catch "overlapping go" by default. |
|
SecondTimer(boolean catchOverlappingGo)
|
|
| Method Summary | |
|---|---|
String |
getEventsPerSecond(long nEvents)
Calculates the number of events that occured per second, on average, during the time this timer was accumulating. |
long |
getMilliseconds()
Gets the number of milliseconds accumulated by this second timer so far |
double |
getSeconds()
Gets the number of seconds accumulated by this SecondTimer so far |
void |
go()
If the timer |
void |
pause()
If the timer is currenting "going" then this stops the accumulation of time. |
void |
reset()
Resets the amount of time accumulated by this timer to zero. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SecondTimer()
public SecondTimer(boolean catchOverlappingGo)
catchOverlappingGo - If true, calling go()
twice without calling pause() will
throw an exception| Method Detail |
|---|
public String getEventsPerSecond(long nEvents)
nEvents - The number of events that occurred
while this SecondTimer has been accumulating
time.
public double getSeconds()
public long getMilliseconds()
public void go()
RuntimeException - if catchOverlappingGo
was set to true and this is the second
call to go() without a previous call to
pause()public void pause()
public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||