Learn to use console.time with console.timeEnd to get accurate timings of operations in javascript. This tool can help with javascript profiling and performance optimization, and knowing how to use the console to do it means you don't have to pollute your codebase with timers and placeholders.
console.time("key"); var array = []; for(var i = 0; i < 1000000; i++){ array.push({index: i}); } console.timeEnd("key");