javascript计算代码执行时间

同步代码执行代码花费



  const start = performance.now();

  // 这里写你的代码 ......

  const time  = performance.now()-start;

  console.log('花费时间:'+time)


posted @ 2022-08-11 19:53  jingjingxyk  阅读(456)  评论(0编辑  收藏  举报