diff --git a/lighthouse-core/audits/time-to-interactive.js b/lighthouse-core/audits/time-to-interactive.js index d02c659039c6..b97d498f8064 100644 --- a/lighthouse-core/audits/time-to-interactive.js +++ b/lighthouse-core/audits/time-to-interactive.js @@ -79,21 +79,17 @@ class TTIMetric extends Audit { const fMPts = timings.fMPfull + timings.navStart; // look at speedline results for 85% starting at FMP - let eightyFivePctVC; let visuallyReadyTiming = 0; if (artifacts.Speedline.frames) { - eightyFivePctVC = artifacts.Speedline.frames.find(frame => { + const eightyFivePctVC = artifacts.Speedline.frames.find(frame => { return frame.getTimeStamp() >= fMPts && frame.getProgress() >= 85; }); - // Check to avoid closure compiler null dereferencing errors - if (eightyFivePctVC === undefined) { - eightyFivePctVC = 0; + if (eightyFivePctVC) { + // TODO CHECK these units are the same + visuallyReadyTiming = eightyFivePctVC.getTimeStamp() - timings.navStart; } - - // TODO CHECK these units are the same - visuallyReadyTiming = eightyFivePctVC.getTimeStamp() - timings.navStart || 0; } // Find first 500ms window where Est Input Latency is <50ms at the 90% percentile.