Skip to content

Measuring execution times

Imagine you have a asynchronous function valled asyncOperation(), and know you would like to measure the time it takes to complete this operation. We can start measuring those times with console.time([timerName]) and end it with console.timeEnd([timerName]):

console.time("async operation");
console.timeEnd("async operation");

The output of this code would be:

async operation: 128.941ms


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.