| java.lang.Object fri.util.TimeStopper
TimeStopper | public class TimeStopper (Code) | | Stopwatch, for testing purposes. Provides suspend and resume methods.
|
Constructor Summary | |
public | TimeStopper() Catch current time. | public | TimeStopper(boolean doStart) If doStart is false, start() or resume() must be called explicitly. |
Method Summary | |
public String | getInterval() Returns the time interval since start or the last getInterval() call. | public String | getTime() Returns current time representation "HH:MM:SS". | public String | getTimeMillis() Returns current time representation in millisconds. | public boolean | isRunning() Returns true if the timer is running, else it has been stopped or suspended. | final public static void | main(String[] args) | public void | resume() Start again after interruption. | public void | start() Start the timer after a stop(). | public String | stop() Stop the timer and return current time sum. | public String | stopMillis() Stop the timer and return current time sum. | public void | suspend() Interrupt timer. |
TimeStopper | public TimeStopper()(Code) | | Catch current time. Timer is running. This is a call to resume().
|
TimeStopper | public TimeStopper(boolean doStart)(Code) | | If doStart is false, start() or resume() must be called explicitly.
|
getInterval | public String getInterval()(Code) | | Returns the time interval since start or the last getInterval() call.
|
getTime | public String getTime()(Code) | | Returns current time representation "HH:MM:SS".
The timer will be stopped for calculation of time and then be resumed.
|
getTimeMillis | public String getTimeMillis()(Code) | | Returns current time representation in millisconds.
The timer will be stopped for calculation and then be resumed.
|
isRunning | public boolean isRunning()(Code) | | Returns true if the timer is running, else it has been stopped or suspended.
|
resume | public void resume()(Code) | | Start again after interruption. Pause time will not be added.
This method works if the timer was suspended before, else it does nothing.
|
start | public void start()(Code) | | Start the timer after a stop(). The sum of time is forgotten.
|
stop | public String stop()(Code) | | Stop the timer and return current time sum.
|
stopMillis | public String stopMillis()(Code) | | Stop the timer and return current time sum.
|
suspend | public void suspend()(Code) | | Interrupt timer. Time gets saved. This method works if the timer
was started or resumed before, else it does nothing.
|
|
|