aisowe

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

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

performance.now(); // 295741.5400000755

 

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

分类:

技术点:

相关文章:

  • 2021-12-06
  • 2021-12-03
  • 2021-08-07
  • 2021-12-06
  • 2021-12-29
  • 2021-12-19
  • 2021-12-06
  • 2021-10-10
猜你喜欢
  • 2021-12-19
  • 2021-12-06
  • 2021-09-19
  • 2021-12-10
  • 2021-12-10
  • 2021-11-27
  • 2021-11-06
相关资源
相似解决方案