HTML DOM console time() Method Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The console.time() method in HTML is used to start a timer in the console view. The console.time() method can be used for calculating the time of programs for various testing purposes. The label is sent as a parameter to the console.time() method. Syntax:console.time( label )Parameters: This method accepts a single parameter label which is optional and used to specify the label of the timer. Example 1: Below programs illustrate the console.time() method in HTML. html <!DOCTYPE html> <html> <head> <title>DOM console.time() Method in HTML</title> <style> h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM console.time() Method</h2> <p> To view the message in the console press the F12 key on your keyboard. </p> <p> To view the time taken by a for loop to run 100 times, double click the button below: </p> <br> <button ondblclick="table_time()"> RUN TIMER </button> <script> function table_time() { console.time(); for (i = 0; i < 100; i++) { // Random code } console.timeEnd(); } </script> </body> </html> Output:Example 2: Calculate the time taken by a while loop using console.time() method HTML <!DOCTYPE html> <html> <head> <title>DOM console.time() Method in HTML</title> <style> h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>DOM console.time() Method</h2> <p> To view the message in the console press the F12 key on your keyboard. </p> <p> To view the time taken by a for loop to run 100 times, double click the button below: </p> <br> <button ondblclick="table_time()"> RUN TIMER </button> <script> function table_time() { i = 0; console.time ("While loop for 100 iterations"); while (i < 100) { i++; } console.timeEnd ("While loop for 100 iterations"); } </script> </body> </html> Output:Supported Browsers: The browser is supported by the console.time() Methods are listed below:Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM appendChild() Method S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM console table() Method The console.table() method in HTML is used for writing data in tabular form in the console view. The table data is sent as a parameter to the console.table() method which must be an object or an array containing the data to be filled in the table. Syntax:console.table( tabledata, tablecolumns );Para 3 min read HTML DOM appendChild() Method The HTML DOM appendChild() method adds a new child node to the end of a specified parent node's child list. It can move existing nodes or add new nodes, allowing dynamic updates to the document structure by appending elements, text, or other nodes.Syntax:node.appendChild(node);Parameters: This metho 3 min read HTML DOM images Collection Property The images collection property in HTML is used to return the collection of <img> elements in the document. It can be used for knowing the count of images inserted in the document using the <img> tag. The <input> elements with type = image are not counted in the image property.Synta 4 min read HTML DOM console group() Method The console.group() method in HTML is used to create a group of messages in the console. It indicates the start of a message group and all the messages written after calling the console.group() method will write inside the message group. The label is sent as an optional parameter to the console.grou 2 min read HTML DOM console.assert( ) Method The console.assert() method in HTML is used to write a message for the user on the console only if the expression evaluates to false. The expression and the message are sent as parameters to the console.assert() method. Syntax:console.assert( expression, message )Parameters: This method accepts two 2 min read HTML DOM console.info() Method The console.info() method in HTML is used for writing a message in the console. It indicates an important message about any element or object. The message is sent as a parameter to the console.info() method.Syntax:  console.info( message )Parameters: This method accepts a single parameter message wh 2 min read HTML DOM URL Property The DOM URL property in HTML is used to return a string that contains the complete URL of the current document. The string also includes the HTTP protocol such as ( http://).Syntax:document.URLReturn Value: It returns a string value that represents the full URL of the document. Example: In this exam 2 min read HTML DOM head Property The head property in HTML is used to return the first occurrence of the head if multiple heads in the document. It returns the reference of the head object, which represents the <head> elementSyntax: document.headReturn value: It returns the <head> element of the head object.Example: The 2 min read HTML DOM embeds Collection The DOM embeds collection property in HTML is used to return the collection of all embedded elements. The elements in the collection are sorted that appear in the source code. This property is used for read-only. Syntax: document.embedsProperty: This property contains a value length that returns the 3 min read HTML DOM console warn() Method The console.warn() method is used to write a warning message in the console. So open the console to display the output (warning message). Syntax:console.warn( message )Parameters: This method accepts single parameter message which is mandatory. This parameter is used to hold the warning message. Exa 2 min read Like