javascript script execution time

The console.time method is to start counting the time, and the console.timeEnd is to stop the time

// start the timer
console.time('time');

// (write some test code)

// stop timing, output time
console.timeEnd('time'); 


Since the js script is parsed from top to bottom, 
the execution time of the intermediate code can be calculated by +new Date() or new Date().getTime()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324848257&siteId=291194637