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.

Contents

[edit] Syntax

console.timeEnd(name)

[edit] Parameters

[edit] name

Label used for the timer. required

[edit] Examples

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.

[edit] See also

Personal tools