mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 20:15:11 +00:00
[ReactNative] Improvements on perf measurement output
This commit is contained in:
parent
f377849c73
commit
278932e61e
@ -37,6 +37,19 @@ var RCTRenderingPerf = {
|
|||||||
ReactDefaultPerf.stop();
|
ReactDefaultPerf.stop();
|
||||||
ReactDefaultPerf.printInclusive();
|
ReactDefaultPerf.printInclusive();
|
||||||
ReactDefaultPerf.printWasted();
|
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());
|
perfModules.forEach((module) => module.stop());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user