/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/src/private/webapis/performance/internals/Utilities.js
27 строк
768 B
Rubén Norte
Small refactor of performance API (#52558)
11 июл 2025, 15:37
11 июл 2025, 15:37
5e0eb0a
Код
Авторство
О чём код?
/** * 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 warnOnce from '../../../../../Libraries/Utilities/warnOnce'; import NativePerformance from '../specs/NativePerformance'; export function warnNoNativePerformance() { warnOnce( 'missing-native-performance', 'Missing native implementation of Performance', ); } declare var global: { // This value is defined directly via JSI, if available. +nativePerformanceNow?: ?() => number, }; export const getCurrentTimeStamp: () => DOMHighResTimeStamp = NativePerformance?.now ?? global.nativePerformanceNow ?? (() => Date.now());