DEV Community

Cover image for Measure execution time of function in javascript
Abhilash
Abhilash

Posted on

Measure execution time of function in javascript

As we thrive to build performant and scalable applications, profiling and measuring execution time becomes an important part of development.
Often, we need to locate the piece of code that is taking most of the time in the execution stack.

Though there are different ways to measure execution time in javascript, I struggled to find something customizable.
Here's an attempt to create a simple yet customizable function that measures the execution time of given functions.

Top comments (0)