|
Voyager ORB | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectspace.lib.timer.Stopwatch
A Stopwatch offers basic timing facilities as well as the ability to record individual lap times.
Constructor Summary | |
Stopwatch()
Construct myself to be a reset stopwatch. |
Method Summary | |
double |
getAverageLapTime()
Return the average lap time in milliseconds. |
java.util.Date |
getDate()
Return the current date. |
int |
getLapCount()
Return the current lap count. |
long |
getLapTime()
Return the last lap time. |
long[] |
getLapTimes()
Return an array of longs that contain the number of milliseconds for each recorded lap or an empty array if lap times were not recorded. |
long |
getMilliseconds()
Return the current time as milliseconds since January 1, 1970, 00:00:00 GMT. |
long |
getTotalTime()
Return the sum of all the individual lap times in milliseconds. |
boolean |
isRecordLapTimes()
Return true if the recording of lap times is enabled. |
void |
lap()
Stop the stopwatch to record a lap time and then immediately start the stopwatch again. |
void |
reset()
Reset the stopwatch, clear the lap times, and set the lap count to zero. |
void |
setRecordLapTimes(boolean flag)
If flag is true, enable the recording of lap times. |
void |
start()
Start the stopwatch. |
void |
stop()
Stop the stopwatch, increment the lap count, and record the lap time if enabled. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Stopwatch()
Method Detail |
public java.util.Date getDate()
public long getMilliseconds()
public void reset()
public void start()
public void stop()
public void lap()
public void setRecordLapTimes(boolean flag)
public boolean isRecordLapTimes()
public int getLapCount()
public long getLapTime()
public long[] getLapTimes()
public long getTotalTime()
public double getAverageLapTime()
|
ObjectSpace Inc. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |