From 1d802da7d2d73ddb98e39006cca4694a53033dbc Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 3 May 2016 19:19:56 -0700 Subject: [PATCH] Fix JSWatchdog reset Reviewed By: ericvicenti Differential Revision: D3249690 fb-gh-sync-id: 00221d7b3a669b0feb2061b5f6e703339c147172 fbshipit-source-id: 00221d7b3a669b0feb2061b5f6e703339c147172 --- Libraries/Interaction/JSEventLoopWatchdog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Interaction/JSEventLoopWatchdog.js b/Libraries/Interaction/JSEventLoopWatchdog.js index 5a23ad3bd76..88c48353c56 100644 --- a/Libraries/Interaction/JSEventLoopWatchdog.js +++ b/Libraries/Interaction/JSEventLoopWatchdog.js @@ -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 = []; module.exports = JSEventLoopWatchdog;