console.time & console.timeEnd
console.time starts the time and
console.timeEnd stops the timer and spits out the duration:
// Kick off the timer
// (Do some testing of a forEach, for example)
// End the timer, get the elapsed time
// 4522.303ms (or whatever time elapsed)
Passing a timer name as the first argument allows you to manage concurrent timers. The
console.timeEnd call immediately spits out the elapsed time in milliseconds.
There are more advanced techniques for performance testing and benchmarking but
timeEnd provide a quick manual method for speed testing!
It's no secret that Facebook has become a major traffic driver for all types of websites. Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly. And of course there are Facebook "Like" and "Recommend" widgets on every website. One...