var t0 = performance.now(); for (let i = 0; i < 10000; i++) { // Do stuff here } // Do some other stuff here var t1 = performance.now(); console.log("Call to doSomething took " + (t1 - t0) + " ms.")
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter