Skip to content

Commit

Permalink
RCTPerformanceNow -> nativePerformanceNow
Browse files Browse the repository at this point in the history
Summary:
public

Rename `RCTPerformanceNow` to `nativePerformanceNow` to be consistent with Android
and the pattern we've been following where the native functions exposed to JSC
are prefixed with `native`.

Also change it to return fractional milliseconds, as the web (`performance.now`)
does: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now

Reviewed By: mikearmstrong001

Differential Revision: D2755287

fb-gh-sync-id: 2acada5673633858ae0bbcdcfae554183e36cb24
  • Loading branch information
tadeuzagallo authored and facebook-github-bot-5 committed Dec 15, 2015
1 parent f43e864 commit e39657a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions React/Executors/RCTContextExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ - (void)setUp
[weakBridge handleBuffer:calls batchEnded:NO];
};

context[@"RCTPerformanceNow"] = ^{
return CACurrentMediaTime() * 1000 * 1000;
context[@"nativePerformanceNow"] = ^{
return @(CACurrentMediaTime() * 1000);
};

#if RCT_DEV
Expand Down

0 comments on commit e39657a

Please sign in to comment.