Use nativeQPLTimestamp for InitializeCore marker point

Summary: It seems like `nativePerformanceNow` might not be getting installed in time to be used by InitializeCore on Android. Using PerformanceLogger.currentTimestamp instead, which uses nativeQPLTimestamp (which is what we should be using anyway)

Reviewed By: alexeylang

Differential Revision: D12875187

fbshipit-source-id: 6eda5d2ed7948ba48c63f76b40b2014511c32494
This commit is contained in:
Emily Janzer 2018-11-09 14:10:12 -08:00 committed by Facebook Github Bot
parent df7e8c64ff
commit 1850906e5e
1 changed files with 10 additions and 7 deletions

View File

@ -25,8 +25,7 @@
*/ */
'use strict'; 'use strict';
const startTime = const start = Date.now();
global.nativePerformanceNow != null ? global.nativePerformanceNow() : null;
require('setUpGlobals'); require('setUpGlobals');
require('polyfillES6Collections'); require('polyfillES6Collections');
@ -45,8 +44,12 @@ if (__DEV__) {
require('setUpDeveloperTools'); require('setUpDeveloperTools');
} }
if (startTime != null) { const PerformanceLogger = require('PerformanceLogger');
const PerformanceLogger = require('PerformanceLogger'); // We could just call PerformanceLogger.markPoint at the top of the file,
PerformanceLogger.markPoint('initializeCore_start', startTime); // but then we'd be excluding the time it took to require PerformanceLogger.
PerformanceLogger.markPoint('initializeCore_end'); // Instead, we just use Date.now and backdate the timestamp.
} PerformanceLogger.markPoint(
'initializeCore_start',
PerformanceLogger.currentTimestamp() - (Date.now() - start),
);
PerformanceLogger.markPoint('initializeCore_end');