JavaScript Bagaimana cara mengukur waktu loop

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