Fix JSWatchdog reset

Reviewed By: ericvicenti

Differential Revision: D3249690

fb-gh-sync-id: 00221d7b3a669b0feb2061b5f6e703339c147172
fbshipit-source-id: 00221d7b3a669b0feb2061b5f6e703339c147172
This commit is contained in:
Spencer Ahrens 2016-05-03 19:19:56 -07:00 committed by Facebook Github Bot 5
parent ee5a1deb0b
commit 1d802da7d2
1 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,7 @@ const JSEventLoopWatchdog = {
totalStallTime = 0;
stallCount = 0;
longestStall = 0;
lastInterval = performanceNow();
},
addHandler: function(handler: Handler) {
handlers.push(handler);
@ -49,7 +50,7 @@ const JSEventLoopWatchdog = {
return;
}
installed = true;
let lastInterval = performanceNow();
lastInterval = performanceNow();
function iteration() {
const now = performanceNow();
const busyTime = now - lastInterval;
@ -80,6 +81,7 @@ let installed = false;
let totalStallTime = 0;
let stallCount = 0;
let longestStall = 0;
let lastInterval = 0;
const handlers: Array<Handler> = [];
module.exports = JSEventLoopWatchdog;