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!
One of the worst kept secrets about AJAX on the web is that the underlying API for it,
XMLHttpRequest, wasn't really made for what we've been using it for. We've done well to create elegant APIs around XHR but we know we can do better. Our effort to...
As broadband speed continues to get faster, the web continues to be more media-centric. Sometimes that can be good (Netflix, other streaming services), sometimes that can be bad (wanting to read a news article but it has an accompanying useless video with it). And every social service does...