aisowe

怎样获取网页加载到现在的时间

可以在网页onload时存一个当前时间的时间戳, 后面需要用到时再用当前时间戳相减得到, 但还有更好的办法: 

performance.now(); // 295741.5400000755

 

performance.now() 会返回一个高精度的时间戳, 用于表示当前网页的加载时间.

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2021-09-21
  • 2022-01-18
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-05-26
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案