|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ds.fw.utils.FwTimer
A simple timer.
| Field Summary | |
long |
accumulation
Contains information how much time(in milliseconds) the timer is running or has run |
java.lang.String |
name
The timer name |
long |
start
If this variable has value -1 then the timer is stopped, otherwise - the timer is working |
| Constructor Summary | |
FwTimer()
The constructor . |
|
FwTimer(java.lang.String s)
The constructor. |
|
| Method Summary | |
long |
_getNow()
Gets the current system time in milliseconds |
double |
getMilliseconds()
Returns the time in milliseconds for which the timer has worked or the time since it has been started (in case it is still working) |
java.lang.String |
getName()
Gets the name |
double |
getSeconds()
Gets the time in seconds for which the timer has worked or the time since it has been started (in case it is still working) |
void |
initialize()
Initsialize the fields of this object with default values. |
boolean |
isRunning()
Check if the timer is started. |
void |
reset()
Reset the value of the timer. |
void |
setName(java.lang.String s)
Sets the name |
void |
start()
Starts the timer. |
static com.ds.fw.utils.FwTimer |
start(java.lang.String s)
Starts the timer and sets the timer field name |
void |
stop()
Stops the timer. |
java.lang.String |
toString()
Returns a string with the name of the timer(if there is any) and the seconds for which the timer has worked or the time (in seconds) since it has been started (in case it is still working). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public java.lang.String name
public long start
public long accumulation
| Constructor Detail |
public FwTimer()
public FwTimer(java.lang.String s)
| Method Detail |
public static com.ds.fw.utils.FwTimer start(java.lang.String s)
s - the timer name
public void initialize()
public void start()
public void stop()
public void reset()
public java.lang.String getName()
public void setName(java.lang.String s)
s - - the new namepublic boolean isRunning()
public double getMilliseconds()
public double getSeconds()
public java.lang.String toString()
toString in class java.lang.Objectpublic long _getNow()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||