|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface TimerInterface
An interface for timers. All time units are measured in milliseconds. This simple timer interface is used for measuring a duration of time; i.e. measure how much time an action takes to execute.
Several references are made to the Epoch, which is the name given to the special date/time value of 00:00:00 January 1, 1970 UTC. Millisecond date/time values are measured relative to the Epoch.
| Name | startTime |
| Type | long |
| Default value | 0 |
| Short description | start time |
| Description | Time when the timer was started, measured in milliseconds after the Epoch |
| Name | stopTime |
| Type | long |
| Default value | 0 |
| Short description | stop time |
| Description | Time when the timer was stopped, in milliseconds after the Epoch |
| Name | duration |
| Type | long |
| Short description | timer duration in milliseconds |
| Description | Amount of time in milliseconds the timer has run. |
| Name | running |
| Type | boolean |
| Default value | false |
| Short description | true if the timer is running |
| Description | true if and only if the timer is currently running. |
AlarmInterface,
Timer,
Alarm| Field Summary |
|---|
| Fields inherited from interface com.sas.util.TimeIntervals |
|---|
ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK |
| Method Summary | |
|---|---|
long |
getDuration()
Return how long this timer has been running, in milliseconds. |
long |
getStartTime()
Return this timer's start time. |
long |
getStopTime()
Return this timer's stop time. |
boolean |
isRunning()
Test if this timer is running. |
void |
setRunning(boolean newState)
Change the running state of this timer. |
void |
start()
Start the timer. |
void |
stop()
Stop the timer. |
| Method Detail |
|---|
void start()
void stop()
void setRunning(boolean newState)
start()
or stop(), but only if newState differs from the
current running state of this timer.
newState - The new running state of this timer.
If newState == isRunning(), do nothing. Otherwise, this
timer should behave as:
if (newState) start(); else stop();boolean isRunning()
true if this timer is running, false if not.
start() sets a timer
running, stop() stops a timer.long getStartTime()
long getStopTime()
long getDuration()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||