From e39657aaae47c1d9afee10c771d5c487d53efadb Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Tue, 15 Dec 2015 14:51:10 -0800 Subject: [PATCH] RCTPerformanceNow -> nativePerformanceNow 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 --- React/Executors/RCTContextExecutor.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/Executors/RCTContextExecutor.m b/React/Executors/RCTContextExecutor.m index 5d8504fb2..0bf9c0caf 100644 --- a/React/Executors/RCTContextExecutor.m +++ b/React/Executors/RCTContextExecutor.m @@ -260,8 +260,8 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) [weakBridge handleBuffer:calls batchEnded:NO]; }; - context[@"RCTPerformanceNow"] = ^{ - return CACurrentMediaTime() * 1000 * 1000; + context[@"nativePerformanceNow"] = ^{ + return @(CACurrentMediaTime() * 1000); }; #if RCT_DEV