mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-12 11:03:06 +00:00
Replace fbjs performanceNow with performance.now
Close #2337 Ref ##2333
This commit is contained in:
committed by
Nicolas Gallagher
parent
8c365d9892
commit
07feddf300
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user