|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opmath.util.time.Timer
A general purpose millisecond timer.
The timer is structured so as to support output in hours, minutes, seconds, and milliseconds.
NOTE: All Timer methods are synchronized.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Constructor Summary | |
Timer()
Constructs a new Timer object. |
|
| Method Summary | |
long |
getHours()
Returns the elapsed time in hours. |
long |
getMinutes()
Returns the elapsed time in minutes. |
long |
getSeconds()
Returns the elapsed time in seconds. |
long |
getTime()
Returns the elapsed time in milliseconds. |
void |
mark()
Reset the elapsed time counter. |
String |
toString()
Returns the elapsed time as a formatted String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Timer()
Constructs a new Timer object.
The timer is initially set to 0. Thus, if the elapsed time for this
Timer object is read before mark() is called,
the time will equal the System time.
mark()| Method Detail |
public void mark()
Reset the elapsed time counter.
If the elapsed time is subsequently read, it will equal the difference between the
time at which mark() is executed, and the current System
time.
public long getTime()
Returns the elapsed time in milliseconds.
long number of milliseconds.public long getHours()
Returns the elapsed time in hours.
long number of whole hours.public long getMinutes()
Returns the elapsed time in minutes.
long number of whole minutes.public long getSeconds()
Returns the elapsed time in seconds.
long number of whole seconds.public String toString()
Returns the elapsed time as a formatted String.
The returned string is in the form: hhh:mm:ss.ttt.
toString in class ObjectType carrying something.
|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||