|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.Timer
Keeps track of execution times. This class provides methods that can be used for timing processes. The process to be timed should be bracketed by calls to timer.start() and timer.stop(). Repeated operations can be timed more than once. The timer will report the minimum, maximum, average and last time executed for all start/stop pairs when the timer.dump is called.
Method Summary | |
void |
dump()
Dump the timer. |
static void |
dumpAll()
Dump all timers |
double |
getAverageTime()
Gets the average time for this timer in milliseconds |
long |
getCount()
Gets the count of starts for this timer |
long |
getCurTime()
Returns the latest time gathered |
long |
getMaxTime()
Gets the max time for this timer in milliseconds |
long |
getMinTime()
Gets the min time for this timer in milliseconds |
java.lang.String |
getName()
Retrieves the name of the timer |
static Timer |
getTimer(java.lang.String timerName)
Retrieves (or creates) a timer with the given name |
boolean |
isStarted()
Returns true if the timer has started. |
void |
reset()
Resets the timer as if it has never run before. |
static void |
resetAll()
Resets all timers |
void |
start()
Starts the timer running. |
void |
start(long time)
Starts the timer at the given time. |
static void |
start(java.lang.String name)
Starts a timer by name |
void |
stop()
Stops the timer. |
long |
stop(boolean verbose)
Stops the timer. |
static void |
stop(java.lang.String name)
Stops a timer by name |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Timer getTimer(java.lang.String timerName)
timerName
- the name of the particular timer to retrieve. If
the timer does not already exist, it will be created
public static void dumpAll()
public static void resetAll()
public java.lang.String getName()
public void reset()
public boolean isStarted()
public void start()
public void start(long time)
time
- the starting timepublic long stop(boolean verbose)
verbose
- if true
, print out details from
this run; otherwise, don't print the details
public void stop()
public static void start(java.lang.String name)
name
- the name of the timer to startpublic static void stop(java.lang.String name)
name
- the name of the timer to stoppublic void dump()
public long getCount()
public long getCurTime()
public double getAverageTime()
public long getMinTime()
public long getMaxTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |