Difference between revisions of "Console.timeEnd"

From FirebugWiki
Jump to: navigation, search
(Separate Console API page for console.timeEnd())
 
m (Added categories)
 
Line 23: Line 23:
 
* [[console.time]]
 
* [[console.time]]
 
* [[Console API]]
 
* [[Console API]]
 +
 +
[[Category:Firebug]]
 +
[[Category:UI]]
 +
[[Category:API]]

Latest revision as of 17:12, 21 November 2013

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]