Console Demos: console.time

Don't use


var startDate = new Date();
/* lots of code here */
var timeTaken = newDate() - startDate; 
                           
                        

use


console.time("Some Scenario"); 
/* lots of code here */
console.timeEnd("Some Scenario"); 

                        

console.time

  • Start with console.time("profileName")
  • End with console.timeEnd("profileName"
  • Measure the time between two matching profile names with a high performance counter

Also

  • Calls can be nested as they are closed by name
  • You can edit JavaScript to add code
  • For the best performance results don't forget to disconnect the debugger