Console.timeEnd

From FirebugWiki
Jump to: navigation, search

Stops a timer created by a call to console.time() and writes the time elapsed since then.

Syntax[edit]

console.timeEnd(name)

Parameters[edit]

name[edit]

Label used for the timer. required

Examples[edit]

console.time("assignments");
for (var i=0; i<1000000; i++)
  var a = 1;
console.timeEnd("assignments");

This measures the time how long one million assignments in a for loop take and prints the result to the console. The call to console.timeEnd("assignments") will stop the timer called "assignments" and print the elapsed time.

See also[edit]