Skip to content

Commit

Permalink
update ProfilingUtils usage
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Sep 17, 2015
1 parent 43eac0e commit 15e8684
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public static void dump() {
getInstance().dumpToLog();
}

public static void stop() {
getInstance().reset(null);
}

private static ProfilingUtils getInstance() {
if (sInstance == null) {
sInstance = new ProfilingUtils();
Expand Down Expand Up @@ -56,12 +60,18 @@ public void reset() {
}

public void addSplit(String splitLabel) {
if (mLabel == null) {
return;
}
long now = SystemClock.elapsedRealtime();
mSplits.add(now);
mSplitLabels.add(splitLabel);
}

public void dumpToLog() {
if (mLabel == null) {
return;
}
AppLog.d(T.PROFILING, mLabel + ": begin");
final long first = mSplits.get(0);
long now = first;
Expand Down

0 comments on commit 15e8684

Please sign in to comment.