Merge "Use push/peek/pop for operations on stack"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0cde53ea13
@@ -52,12 +52,11 @@ public class BootTimingsTraceLog {
|
||||
if (!DEBUG_BOOT_TIME) {
|
||||
return;
|
||||
}
|
||||
// Pop the top element without throwing NoSuchElementException
|
||||
Pair<String, Long> event = mStartTimes.pollFirst();
|
||||
if (event == null) {
|
||||
if (mStartTimes.peek() == null) {
|
||||
Slog.w(mTag, "traceEnd called more times than traceBegin");
|
||||
return;
|
||||
}
|
||||
Pair<String, Long> event = mStartTimes.pop();
|
||||
// Log the duration so it can be parsed by external tools for performance reporting
|
||||
Slog.d(mTag, event.first + " took to complete: "
|
||||
+ (SystemClock.elapsedRealtime() - event.second) + "ms");
|
||||
|
||||
Reference in New Issue
Block a user