|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.util.TimingLogger
public class TimingLogger
A utility class to help log timings splits throughout a method call. Typical usage is: TimingLogger timings = new TimingLogger(TAG, "methodA"); ... do some work A ... timings.addSplit("work A"); ... do some work B ... timings.addSplit("work B"); ... do some work C ... timings.addSplit("work C"); timings.dumpToLog(); The dumpToLog call would add the following to the log: D/TAG ( 3459): methodA: begin D/TAG ( 3459): methodA: 9 ms, work A D/TAG ( 3459): methodA: 1 ms, work B D/TAG ( 3459): methodA: 6 ms, work C D/TAG ( 3459): methodA: end, 16 ms
| Field Summary | |
|---|---|
(package private) ArrayList<String> |
mSplitLabels
Stores the labels for each split. |
(package private) ArrayList<Long> |
mSplits
Stores the time of each split. |
| Constructor Summary | |
|---|---|
TimingLogger(String tag,
String label)
Create and initialize a TimingLogger object that will log using the specific tag. |
|
| Method Summary | |
|---|---|
void |
addSplit(String splitLabel)
Add a split for the current time, labeled with splitLabel. |
void |
dumpToLog()
Dumps the timings to the log using Log.d(). |
void |
reset()
Clear and initialize a TimingLogger object that will log using the tag and label that was specified previously, either via the constructor or a call to reset(tag, label). |
void |
reset(String tag,
String label)
Clear and initialize a TimingLogger object that will log using the specific tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
ArrayList<Long> mSplits
ArrayList<String> mSplitLabels
| Constructor Detail |
|---|
public TimingLogger(String tag,
String label)
tag - the log tag to use while logging the timingslabel - a string to be displayed with each log| Method Detail |
|---|
public void reset(String tag,
String label)
tag - the log tag to use while logging the timingslabel - a string to be displayed with each logpublic void reset()
public void addSplit(String splitLabel)
splitLabel - a label to associate with this split.public void dumpToLog()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||