|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnetflix.utilities.MethodTimer
public class MethodTimer
This class can be used to profile program execution by keeping track of the time spent in each method and the average time per call. To use this class create a global MethodTimer object, and call the start method at the beginning of every method and stop at the end. At the end of executing the timings can be retrieved using the printTimings function.
| Constructor Summary | |
|---|---|
MethodTimer()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
printTimes()
Prints all the timings managed by this MethodTimer. |
void |
start(java.lang.String methodName)
Starts a timer for the specfied method. |
void |
stop(java.lang.String methodName)
Ends the tiemr for the specified method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodTimer()
| Method Detail |
|---|
public void start(java.lang.String methodName)
methodName - The method to time.
public void stop(java.lang.String methodName)
throws java.lang.RuntimeException
java.lang.RuntimeException - if the specified method name does
not have an associated Timing object.public void printTimes()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||