BUG: performance.now() 的单位应该是ms而不是秒
发布于 5 年前 作者 fsu 9337 次浏览 来自 问答

如果是 Bug:

* Bug 表现是什么?预期表现是什么?

 performance.now()应该是以毫秒为单位的, 但是开发者工具里面是以秒为单位.

https://developer.mozilla.org/en-US/docs/Web/API/Performance/now

* 如何复现?

 performance.now()

1514521561.895

 performance.now()

1514521562.537

两次调用, 开发工具里面

performance.now()

373798.13500000007

performance.now()

374566.895

两次调用, chrome里面.

* 提供一个最简复现 Demo

如上.

我看源代码里面:

var performance = exports.performance = {

  now: function now() {

    return Date.now() / 1000

  }

}

这不要/1000啊

1 回复

我自己先手动把本地的weapp-adapter.js改了. 浪费了好多时间.

回到顶部