How to: In this example:
- We use `console.log` to print a message indicating the start of the function.
- We start a timer named "myFunction" using `console.time("myFunction")`.
- We simulate a time-consuming task by running a loop.
- After the loop is finished, we end the timer using `console.timeEnd("myFunction")`.
- Finally, we use `console.log` to print a message indicating the end of the function.

- Function started
- myFunction: 5431.709ms
- Function ended

The time in milliseconds (ms) represents the runtime of the function `myFunction`. You can use this approach to measure the runtime of specific parts of your code to identify performance bottlenecks or optimize your code.
↥ back to top
#### Q. What is Distributed Denial of Service (DDoS) attacks and how to secure NodeJS REST API from it?
#### Q. What are SOLID principles?
#### Q. How to develop Node.js app using SOLID principles?
↥ back to top