Files
react-native/Libraries/Core/setUpPerformance.js
T
Ruslan Shestopalyuk 14307b8212 Setup a global Performance singleton, according to the standard
Summary:
Makes sure that the global (standard) `performance` instance is initialized to still both provide `Performance.now()` as before, but also allows for the newly implemented functionality from the WebPerf API, such as marks/measures.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42017812

fbshipit-source-id: ddbe79e91b45a84871de94018305f2a4536ada4b
2022-12-14 22:38:12 -08:00

16 lines
351 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import Performance from '../WebPerformance/Performance';
if (!global.performance) {
global.performance = new Performance();
}