Problem Statement
Which console method helps measure how long a function takes to execute?
Explanation
console.time() and console.timeEnd() measure the duration of code execution between the two calls.
They are useful for quick performance checks during development and debugging.
Code Solution
SolutionRead Only
console.time('fetch'); fetchData(); console.timeEnd('fetch');Practice Sets
This question appears in the following practice sets: