|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--laur.tools.Timer
This class implements a timer. The timer can be in one of two states: started or stopped. Method start() makes a transition from stopped to started, and method stop() does a transition from started to stopped. Method time() can be used to get the total time measured by the timer and it can be called when the timer is in either of the two states. Method reset() will reset the timer; if the timer was running then it will continue to run but it will measure time from the moment we called reset(), if the timer was stopped, the time measured will be reset to 0.
Constructor Summary | |
Timer()
Initialize a new timer. |
Method Summary | |
boolean |
isStarted()
This method should be called to find out if the timer is started or not. |
void |
reset()
This method should be called to reset the timer. |
void |
start()
This method should be called to start/restart the timer. |
void |
stop()
This method should be called to stop/pause the timer. |
long |
time()
This method should be called to find out the time measured so far. |
java.lang.String |
toString()
This method returns a string representation of our timer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Timer()
Method Detail |
public void start()
public void stop()
public void reset()
public long time()
public boolean isStarted()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |