Skip to content

Commit ab9a87c

Browse files
committed
[cg] Perf logging
1 parent fca16fb commit ab9a87c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Libraries/Utilities/PerformanceLogger.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ var PerformanceLogger = {
2424
if (timespans[key]) {
2525
if (__DEV__) {
2626
console.log(
27-
'PerformanceLogger: Attempting to add a timespan that already exists'
27+
'PerformanceLogger: Attempting to add a timespan that already exists ',
28+
key
2829
);
2930
}
3031
return;
@@ -40,7 +41,8 @@ var PerformanceLogger = {
4041
if (timespans[key]) {
4142
if (__DEV__) {
4243
console.log(
43-
'PerformanceLogger: Attempting to start a timespan that already exists'
44+
'PerformanceLogger: Attempting to start a timespan that already exists ',
45+
key,
4446
);
4547
}
4648
return;
@@ -56,7 +58,8 @@ var PerformanceLogger = {
5658
if (!timespans[key] || !timespans[key].startTime) {
5759
if (__DEV__) {
5860
console.log(
59-
'PerformanceLogger: Attempting to end a timespan that has not started'
61+
'PerformanceLogger: Attempting to end a timespan that has not started ',
62+
key,
6063
);
6164
}
6265
return;
@@ -75,6 +78,10 @@ var PerformanceLogger = {
7578
return timespans;
7679
},
7780

81+
hasTimespan(key) {
82+
return !!timespans[key];
83+
},
84+
7885
logTimespans() {
7986
for (var key in timespans) {
8087
console.log(key + ': ' + timespans[key].totalTime + 'ms');

0 commit comments

Comments
 (0)