console.time('doSomething') doSomething() // <---- The function you're measuring time for console.timeEnd('doSomething')