Skip to content

Instantly share code, notes, and snippets.

@ifahrentholz
Created July 27, 2013 14:57
Show Gist options
  • Save ifahrentholz/6095080 to your computer and use it in GitHub Desktop.
Save ifahrentholz/6095080 to your computer and use it in GitHub Desktop.
Calculate difference between zero and window.onload
<script>
// calculate difference between zero and window.onload
window.onload = function () {
var stop = new Date();
document.getElementById("content").style.display = "block";
document.getElementById("ms").innerHTML = (stop - start);
};
</script>
...
<script>
/* before script tags add this line: */
var start = new Date();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment