一个函数的执行时间、console.timeEnd

使用 console timer

如果需要知道一个函数的执行时间,可以这么做:

for (let i = 0; i < 100000; i++) {
    
    
  // some code
}
console.timeEnd() // x ms

猜你喜欢

转载自blog.csdn.net/weixin_43131046/article/details/121532206