public Bundle addIteration ( String label ) { mCpuTime = Process . getElapsedCpuTime ( ) - mCpuTime ; mExecTime = SystemClock . uptimeMillis ( ) - mExecTime ; Bundle iteration = new Bundle ( ) ; iteration . putString ( METRIC_KEY_LABEL , label ) ; iteration . putLong ( METRIC_KEY_EXECUTION_TIME , mExecTime ) ; iteration . putLong ( METRIC_KEY_CPU_TIME , mCpuTime ) ; mPerfMeasurement . getParcelableArrayList ( METRIC_KEY_ITERATIONS ) . add ( iteration ) ; mExecTime = SystemClock . uptimeMillis ( ) ; mCpuTime = Process . getElapsedCpuTime ( ) ; return iteration ; }
Add a measured segment and start measuring the next segment . Returns collected data in a Bundle object .