console.time() starts a new timer with an associated label. When
console.timeEnd() is called with the same label, the timer is stopped and the elapsed time is displayed in the console. Timer values are accurate to the sub-millisecond. The strings passed to These functions must match or else the timer will not finish.
Following is the simple example, which will show you how to measuring execution time.
var i = 10;
while ( i-- ) console.log( i );
Note: The only Firefox returns the elapsed time in the timeEnd() call. The other browsers simply report the result to the developer console: the return value of timeEnd() is undefined.
These functions, supported by modern browsers, in starting with Firefox11+, Chrome2+,Safari 4+ and IE11+
There are more advanced techniques for instrumentation but console.time and console.timeEnd provide a quick manual method for speed testing!
More from my site
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.