mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 06:38:13 +00:00
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
56 lines
1.5 KiB
JavaScript
56 lines
1.5 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
/* globals window: true */
|
|
|
|
/**
|
|
* Sets up global variables typical in most JavaScript environments.
|
|
*
|
|
* 1. Global timers (via `setTimeout` etc).
|
|
* 2. Global console object.
|
|
* 3. Hooks for printing stack traces with source maps.
|
|
*
|
|
* Leaves enough room in the environment for implementing your own:
|
|
*
|
|
* 1. Require system.
|
|
* 2. Bridged modules.
|
|
*
|
|
*/
|
|
'use strict';
|
|
|
|
const start = Date.now();
|
|
|
|
require('setUpGlobals');
|
|
require('polyfillES6Collections');
|
|
require('setUpSystrace');
|
|
require('setUpErrorHandling');
|
|
require('checkNativeVersion');
|
|
require('polyfillPromise');
|
|
require('setUpRegeneratorRuntime');
|
|
require('setUpTimers');
|
|
require('setUpXHR');
|
|
require('setUpAlert');
|
|
require('setUpGeolocation');
|
|
require('setUpBatchedBridge');
|
|
require('setUpSegmentFetcher');
|
|
if (__DEV__) {
|
|
require('setUpDeveloperTools');
|
|
}
|
|
|
|
const PerformanceLogger = require('PerformanceLogger');
|
|
// We could just call PerformanceLogger.markPoint at the top of the file,
|
|
// but then we'd be excluding the time it took to require PerformanceLogger.
|
|
// Instead, we just use Date.now and backdate the timestamp.
|
|
PerformanceLogger.markPoint(
|
|
'initializeCore_start',
|
|
PerformanceLogger.currentTimestamp() - (Date.now() - start),
|
|
);
|
|
PerformanceLogger.markPoint('initializeCore_end');
|