Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/react-native/Libraries/Core/setUpPerformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

import Performance from '../../src/private/webapis/performance/Performance';
import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
import {PerformanceMark} from '../../src/private/webapis/performance/UserTiming';

// In case if the native implementation of the Performance API is available, use it,
// otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
if (NativePerformance) {
// $FlowExpectedError[cannot-write]
global.performance = new Performance();
global.PerformanceMark = PerformanceMark;
} else {
if (!global.performance) {
// $FlowExpectedError[cannot-write]
Expand Down
Loading