Improve RCTPerfomanceLogger

Reviewed By: @mikearmstrong001

Differential Revision: D2531397

fb-gh-sync-id: 3f6c1831c9a7b62f857deda7a535589970cf2052
This commit is contained in:
Alexey Lang 2015-10-13 03:43:43 -07:00 committed by facebook-github-bot-7
parent baf5b7b4d5
commit aabdc9cc9f
1 changed files with 7 additions and 1 deletions

View File

@ -11,17 +11,23 @@
#import "RCTPerformanceLogger.h"
#import "RCTRootView.h"
#import "RCTLog.h"
static int64_t RCTPLData[RCTPLSize][2] = {};
void RCTPerformanceLoggerStart(RCTPLTag tag)
{
RCTPLData[tag][0] = CACurrentMediaTime() * 1000;
RCTPLData[tag][1] = 0;
}
void RCTPerformanceLoggerEnd(RCTPLTag tag)
{
if (RCTPLData[tag][0] != 0 && RCTPLData[tag][1] == 0) {
RCTPLData[tag][1] = CACurrentMediaTime() * 1000;
} else {
RCTLogInfo(@"Unbalanced calls start/end for tag %li", (unsigned long)tag);
}
}
NSArray *RCTPerformanceLoggerOutput(void)