Skip to content

Commit 07feddf

Browse files
kyletsangnecolas
authored andcommitted
Replace fbjs performanceNow with performance.now
Close necolas#2337 Ref #necolas#2333
1 parent 8c365d9 commit 07feddf

File tree

1 file changed

+3
-4
lines changed
  • packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog

1 file changed

+3
-4
lines changed

packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'use strict';
1212

1313
import infoLog from '../infoLog';
14-
import performanceNow from 'fbjs/lib/performanceNow';
1514

1615
type Handler = {
1716
onIterate?: () => void,
@@ -39,7 +38,7 @@ const JSEventLoopWatchdog = {
3938
totalStallTime = 0;
4039
stallCount = 0;
4140
longestStall = 0;
42-
lastInterval = performanceNow();
41+
lastInterval = window.performance.now();
4342
},
4443
addHandler: function(handler: Handler) {
4544
handlers.push(handler);
@@ -50,9 +49,9 @@ const JSEventLoopWatchdog = {
5049
return;
5150
}
5251
installed = true;
53-
lastInterval = performanceNow();
52+
lastInterval = window.performance.now();
5453
function iteration() {
55-
const now = performanceNow();
54+
const now = window.performance.now();
5655
const busyTime = now - lastInterval;
5756
if (busyTime >= thresholdMS) {
5857
const stallTime = busyTime - thresholdMS;

0 commit comments

Comments
 (0)