if (mStartTime == -1) {
throw new RuntimeException(
"Calling stop with StopWatch already stopped");
}
long stopTime = SystemClock.elapsedRealtime();
mTotalTime += stopTime - mStartTime;
++mNumCalls;
mStartTime = -1;
if (mNumCalls % STOP_WATCH_LOGGING_PERIOD == 0) {
Log.i(TAG, "AVG ms/call " + mName + ": " +
String.format("%.1f", mTotalTime * 1.0f / mNumCalls));
mTotalTime = 0;
mNumCalls = 0;
}