Skip to content

Instantly share code, notes, and snippets.

@ericjames
Created December 20, 2016 20:16
Show Gist options
  • Save ericjames/df2a74cbc08ecac0fb14866576491a44 to your computer and use it in GitHub Desktop.
Save ericjames/df2a74cbc08ecac0fb14866576491a44 to your computer and use it in GitHub Desktop.
Count number of milliseconds to reach desired "page complete" condition
var counter = setInterval(timer, 1);
var count = 0;
function timer() {
count++;
var ele = document.getElementById("thisdiv");
if (ele.className.indexOf('ng-hide') !== -1) {
clearInterval(counter);
console.log(count, count / 1000);
setTimeout(function() {
window.location.reload(true);
},5000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment