Console.time

From FirebugWiki

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

Latest revision as of 00:12, 22 November 2013

Creates a new timer under the given name. Call console.timeEnd() with the same name to stop the timer and print the time elapsed.

Contents

[edit] Syntax

console.time(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.

[edit] See also

Personal tools