|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.util.FunctionTimer
public class FunctionTimer
Class to measure the elapsed time between events, as marked by calls to the
start
and stop
methods. Mainly intended for use
in timing the execution speed of functions.
Constructor Summary | |
---|---|
FunctionTimer()
Create a new FunctionTimer |
Method Summary | |
---|---|
double |
getResolutionUsec()
Returns the resolution of this timer, in microseconds. |
double |
getTimeUsec()
Returns the elapsed time in microseconds. |
void |
reset()
Sets the elapsed time to 0 and re-initializes the start indicator |
void |
restart()
Marks the beginning of a new timing interval and leaves the elapsed time unchanged. |
java.lang.String |
result(int cnt)
Returns a string describing the current elapsed time, divided by the supplied count parameter. |
java.lang.String |
resultMsec(int cnt)
Returns a string describing the current elapsed time, divided by the supplied count parameter. |
java.lang.String |
resultUsec(int cnt)
Returns a string describing the current elapsed time, divided by the supplied count parameter. |
void |
start()
Marks the beginning of a new timing interval and sets the elapsed time to 0. |
void |
stop()
Adds the time difference between the current time and the last time start or restart was called to the elapsed
time. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionTimer()
Method Detail |
---|
public void start()
public void restart()
public void reset()
public void stop()
start
or restart
was called to the elapsed
time. If start
was not previously called, no change is made
to the elapsed time.
public double getTimeUsec()
start
or restart
has been called but
stop
has not yet been called, the associated time differece
will not be included in the result.
public double getResolutionUsec()
public java.lang.String result(int cnt)
cnt
- count to divide the elapsed time by
public java.lang.String resultUsec(int cnt)
cnt
- count to divide the elapsed time by
public java.lang.String resultMsec(int cnt)
cnt
- count to divide the elapsed time by
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |