Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
Node.js Tutorial
Parts of Node.js
Features of Node.js
Install Node.js Windows
Install Node.js Linux
Node.js First Example
Node.js Console
Node.js REPL
Node.js NPM
Node.js CL Options1
Node.js CL Option2
Node.js Globals
Node.js OS
Node.js Timer
Node.js Errors
Node.js DNS
Node.js Net
Node.js Crypto
Node.js TLS/SSL
Node.js Debugger
Node.js Process
Node.js Process Example
Node.js Process Example2
Node.js Child Process
Child Process EXEC
Child Process SPAWN
Child Process Fork
Node.js Buffers
Node.js Streams
Node.js Reading Stream
Node.js Writing Stream
Node.js Piping Stream
Node.js Chaining Streams
Node.js File System Part1
Node.js File System Part2
Node.js File System Part3
Node.js Path
Node.js StringDecoder
Node.js Query String
Node.js ZLIB
Node.js Assertion
Node.js V8
Node.js Callbacks
Node.js Events
Node.js Punycode
Node.js TTY
Node.js Web Module
Node.js Upload Files
Node.js Email Send
Node.js BuiltIn Modules
Node.js Assert Code
Node.js Assert Function
Node.js console.time()
Node.js console.table()
Node.js DNS Code
Node.js cipher.final()
Node.js URL.hash API
Node.js URL.host API
Node.js URL.origin API
 


  

 
Node.js console.time()
Question Posted on 08 May 2024

Home >> Tutorial >> Node.js Tutorial >> Node.js console.time()


Node.js console.time()

Node.js console.time() Method


When we say about the console close of node.js, console.time() is method is also a console class. And we can used timer to compute the time taken by any piece of code or function. And method console.timeEnd() is used to stop the timer and then the output of elapsed time in milliseconds to stdout. And the timer can be accurate to the sub-millisecond.

And syntax of console.time method is:-'

console.time ( label )



And when we say about the Parameter, this will accepts a single parameter label which can be passed in the method as parameter. And if we not passed the label then a default label is automatically given to the method. And label can be different for different functions or the pieces of code.

Below we have tried to give one example to use of time() method. I have save the below code in .js file and name this file as TimerUsed.js:-


console.time
To download code
click here

Now we run above file in Node.js command prompt as per the below command:-


Node TimerUsed.js



And output of above command is given below:-




console.time output

Now example two and use of Label in console.time() method. And create a below code file and name that file as "TimerUsedLabel.js".
console.time multi label
To view the code Download Code
Now we run above file in Node command prompt as per the below command:-


Node TimerUsedLabel.js



And output of above command is given below:-

multi label node.js

We will take one more example which have 2 labels and time() method use below is code file which name as MultiTimeLabel.js.
multi label node.js
To view the code Download Code
Now we run above file in Node command prompt as per the below command:-


Node MultiTimeLabel.js



And output of above command is given below:-


Multi Label Time





Other Important Questions
Parts of Node.js
Install Node.js Linux
Node.js First Example
Node.js Globals
Node.js DNS







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |