Created
September 10, 2022 14:14
-
-
Save Nav-Appaiya/5180404c254fdf4f2f0fadba286ad106 to your computer and use it in GitHub Desktop.
A javascript snippet to see how long a script or import is taking, will count when executed in your browser console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var start = Date.now(); | |
function output(variable){console.log(variable);} | |
setInterval(function() { | |
var delta = Date.now() - start; // milliseconds elapsed since start | |
output(Math.floor(delta / 1000)); // in seconds | |
// alternatively just show wall clock time: | |
output(new Date().toUTCString()); | |
}, 1000); // update about every second |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment