[cg] Perf logging
This commit is contained in:
parent
fca16fbe40
commit
ab9a87c33a
|
@ -24,7 +24,8 @@ var PerformanceLogger = {
|
|||
if (timespans[key]) {
|
||||
if (__DEV__) {
|
||||
console.log(
|
||||
'PerformanceLogger: Attempting to add a timespan that already exists'
|
||||
'PerformanceLogger: Attempting to add a timespan that already exists ',
|
||||
key
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
@ -40,7 +41,8 @@ var PerformanceLogger = {
|
|||
if (timespans[key]) {
|
||||
if (__DEV__) {
|
||||
console.log(
|
||||
'PerformanceLogger: Attempting to start a timespan that already exists'
|
||||
'PerformanceLogger: Attempting to start a timespan that already exists ',
|
||||
key,
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
@ -56,7 +58,8 @@ var PerformanceLogger = {
|
|||
if (!timespans[key] || !timespans[key].startTime) {
|
||||
if (__DEV__) {
|
||||
console.log(
|
||||
'PerformanceLogger: Attempting to end a timespan that has not started'
|
||||
'PerformanceLogger: Attempting to end a timespan that has not started ',
|
||||
key,
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
@ -75,6 +78,10 @@ var PerformanceLogger = {
|
|||
return timespans;
|
||||
},
|
||||
|
||||
hasTimespan(key) {
|
||||
return !!timespans[key];
|
||||
},
|
||||
|
||||
logTimespans() {
|
||||
for (var key in timespans) {
|
||||
console.log(key + ': ' + timespans[key].totalTime + 'ms');
|
||||
|
|
Loading…
Reference in New Issue