|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.alsUtility.Timer
time things using wallclock time. Will also keep track of time allocated for a task and let you know when time is up.
Field Summary | |
protected long |
lastStart
|
protected boolean |
running
|
protected long |
timeAllocated
|
protected long |
timeUsed
|
Constructor Summary | |
Timer()
|
|
Timer(long t)
|
Method Summary | |
boolean |
isDone()
has the allocated time been used? |
void |
reset()
resets the timer and stops |
void |
reset(long t)
resets the timer and stops |
void |
start()
starts the clock |
void |
stop()
stops the clock and remembers the time used |
static void |
test(java.lang.String[] arguments)
|
long |
timeAvailable()
how much allocated time is still available? |
long |
timeElapsed()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected long timeAllocated
protected long timeUsed
protected long lastStart
protected boolean running
Constructor Detail |
public Timer()
public Timer(long t)
t
- sets the time allocatedMethod Detail |
public java.lang.String toString()
public void reset(long t)
t
- sets the time allocatedpublic void reset()
public void stop()
public void start()
public boolean isDone()
public long timeElapsed()
public long timeAvailable()
public static void test(java.lang.String[] arguments)
|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |