Improve RCTPerfomanceLogger
Reviewed By: @mikearmstrong001 Differential Revision: D2531397 fb-gh-sync-id: 3f6c1831c9a7b62f857deda7a535589970cf2052
This commit is contained in:
parent
baf5b7b4d5
commit
aabdc9cc9f
|
@ -11,17 +11,23 @@
|
||||||
|
|
||||||
#import "RCTPerformanceLogger.h"
|
#import "RCTPerformanceLogger.h"
|
||||||
#import "RCTRootView.h"
|
#import "RCTRootView.h"
|
||||||
|
#import "RCTLog.h"
|
||||||
|
|
||||||
static int64_t RCTPLData[RCTPLSize][2] = {};
|
static int64_t RCTPLData[RCTPLSize][2] = {};
|
||||||
|
|
||||||
void RCTPerformanceLoggerStart(RCTPLTag tag)
|
void RCTPerformanceLoggerStart(RCTPLTag tag)
|
||||||
{
|
{
|
||||||
RCTPLData[tag][0] = CACurrentMediaTime() * 1000;
|
RCTPLData[tag][0] = CACurrentMediaTime() * 1000;
|
||||||
|
RCTPLData[tag][1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RCTPerformanceLoggerEnd(RCTPLTag tag)
|
void RCTPerformanceLoggerEnd(RCTPLTag tag)
|
||||||
{
|
{
|
||||||
|
if (RCTPLData[tag][0] != 0 && RCTPLData[tag][1] == 0) {
|
||||||
RCTPLData[tag][1] = CACurrentMediaTime() * 1000;
|
RCTPLData[tag][1] = CACurrentMediaTime() * 1000;
|
||||||
|
} else {
|
||||||
|
RCTLogInfo(@"Unbalanced calls start/end for tag %li", (unsigned long)tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSArray *RCTPerformanceLoggerOutput(void)
|
NSArray *RCTPerformanceLoggerOutput(void)
|
||||||
|
|
Loading…
Reference in New Issue