Skip to content

Commit cb3a073

Browse files
tadeuzagallofacebook-github-bot-9
authored and
facebook-github-bot-9
committed
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
1 parent ccd90e2 commit cb3a073

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

React/Executors/RCTContextExecutor.m

+4
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ - (void)setUp
353353
[bridge handleBuffer:calls batchEnded:NO];
354354
};
355355

356+
strongSelf->_context.context[@"RCTPerformanceNow"] = ^(){
357+
return CACurrentMediaTime() * 1000 * 1000;
358+
};
359+
356360
#if RCT_DEV
357361
if (RCTProfileIsProfiling()) {
358362
strongSelf->_context.context[@"__RCTProfileIsProfiling"] = @YES;

0 commit comments

Comments
 (0)