Skip to content

Commit

Permalink
tti: simplify logic grabbing 85% vis complete
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jul 28, 2016
1 parent 1c62db3 commit 3906dee
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lighthouse-core/audits/time-to-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3906dee

Please sign in to comment.