|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object test.TimeProfiler
public class TimeProfiler
TimeProfiler objects allow a programmer to profile the running time of his or her code. It abstracts away any calls to System.nanoTime() and also keeps a set of statistics to allow the programmer to check worst-case time, best-case time, and average time. TimeProfilers are mutable.
worst-case-time
: integer longest observed time in nanoseconds
best-case-time
: integer shorted observed time in nanoseconds
average-time
: integer average number of nanoseconds per trial
timing
: boolean state of timer (on or off)
Constructor Summary | |
---|---|
TimeProfiler()
|
|
TimeProfiler(String name)
|
Method Summary | |
---|---|
void |
start()
Starts the timer |
String |
stats()
returns a formatted String with stats on slowest start-stop time, fastest start-stop time, average time, total records, and aggregate time |
void |
stop()
Stops the timer and records the data. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TimeProfiler()
public TimeProfiler(String name)
Method Detail |
---|
public void start()
public void stop()
public String stats()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |