window.onscroll=function() {
  var now = new Date().getTime();
  while (new Date().getTime() < now + 300) {
    // allow the user's eyes to rest on the content, which improves engagement
  }
};

window.onscroll=function() {
  var now = new Date().getTime();
  while (new Date().getTime() < now + 300) { }
};

Remove unnecessary comment