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]):

The output of this code would be:

async operation: 128.941ms

[sc name=”src” url=”https://blog.mariusschulz.com/2013/11/22/measuring-execution-times-in-javascript-with-consoletime” ]

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.