From 07feddf300aa86da0a633d60c05fe0a12594b75d Mon Sep 17 00:00:00 2001 From: kyletsang <6854874+kyletsang@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:03:51 -0700 Subject: [PATCH] Replace fbjs performanceNow with performance.now Close #2337 Ref ##2333 --- .../src/vendor/react-native/JSEventLoopWatchdog/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js b/packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js index 71a06b50..dfe9d48c 100644 --- a/packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js +++ b/packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js @@ -11,7 +11,6 @@ 'use strict'; import infoLog from '../infoLog'; -import performanceNow from 'fbjs/lib/performanceNow'; type Handler = { onIterate?: () => void, @@ -39,7 +38,7 @@ const JSEventLoopWatchdog = { totalStallTime = 0; stallCount = 0; longestStall = 0; - lastInterval = performanceNow(); + lastInterval = window.performance.now(); }, addHandler: function(handler: Handler) { handlers.push(handler); @@ -50,9 +49,9 @@ const JSEventLoopWatchdog = { return; } installed = true; - lastInterval = performanceNow(); + lastInterval = window.performance.now(); function iteration() { - const now = performanceNow(); + const now = window.performance.now(); const busyTime = now - lastInterval; if (busyTime >= thresholdMS) { const stallTime = busyTime - thresholdMS;