Easy Tutorial
❮ Dom Obj Input Image Prop Style Flexbasis ❯

HTML DOM console.timeEnd() Method

Console Object

Example

Time taken to execute 100,000 times:


Definition and Usage

The console.timeEnd() method is used to end a timer.

This method is typically used to measure the duration of program execution.

The console.time() method is used to start a timer.

If a page needs to use multiple timers, you can add a label parameter to set them.

Note: The console needs to be visible during testing (open the console by pressing F12 in the browser).


Syntax

console.timeEnd(label)

Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method
console.timeEnd() Yes 11 10 4 Yes

Parameter Values

Parameter Type Description
label String Optional. A label to identify the timer.
tablecolumns Array Optional. An array of table header names.

More Examples

Example

Using a label parameter:

Example

Testing which code executes faster

Console Object

❮ Dom Obj Input Image Prop Style Flexbasis ❯