[ReactNative] Improvements on perf measurement output

This commit is contained in:
Jing Chen 2015-03-17 20:50:50 -07:00
parent f377849c73
commit 278932e61e
1 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,19 @@ var RCTRenderingPerf = {
ReactDefaultPerf.stop();
ReactDefaultPerf.printInclusive();
ReactDefaultPerf.printWasted();
var totalRender = 0;
var totalTime = 0;
var measurements = ReactDefaultPerf.getLastMeasurements();
for (var ii = 0; ii < measurements.length; ii++) {
var render = measurements[ii].render;
for (var nodeName in render) {
totalRender += render[nodeName];
}
totalTime += measurements[ii].totalTime;
}
console.log('Total time spent in render(): ' + totalRender + 'ms');
perfModules.forEach((module) => module.stop());
},