Expose RCTPerformanceNow, microsecond precision time for JavaScript

Summary: public

Expose a more precise timer, millisecond precision is enough to measure small operations.

Reviewed By: javache

Differential Revision: D2604218

fb-gh-sync-id: ba50c891b5690575548fe04ba1ae7d015bc31d90
This commit is contained in:
Tadeu Zagallo 2015-11-02 08:13:42 -08:00 committed by facebook-github-bot-9
parent ccd90e25c1
commit cb3a07306e

View File

@ -353,6 +353,10 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
[bridge handleBuffer:calls batchEnded:NO];
};
strongSelf->_context.context[@"RCTPerformanceNow"] = ^(){
return CACurrentMediaTime() * 1000 * 1000;
};
#if RCT_DEV
if (RCTProfileIsProfiling()) {
strongSelf->_context.context[@"__RCTProfileIsProfiling"] = @YES;