最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - window.performance.now() is undefined in Safari 9 - Stack Overflow

programmeradmin4浏览0评论

I have a problem with window.performance.now() in Safari 9. My OS is OS X Mavericks in Macbook Pro Mid 2010.

Apple released Safari 9 for OS X Yosemite and Mavericks users: /

caniuse/#search=performance says that in Safari 8 and 9 have support for window.performance.now():

but I just today updated from Safari 7 to Safari 9 and big disappointment: window.performance is undefined!

Should it work? Does it work for someone? Is this problem with my OS and/or hardware?

I have a problem with window.performance.now() in Safari 9. My OS is OS X Mavericks in Macbook Pro Mid 2010.

Apple released Safari 9 for OS X Yosemite and Mavericks users: http://www.macrumors./2015/09/30/apple-releases-safari-9-for-yosemite-users/

caniuse./#search=performance says that in Safari 8 and 9 have support for window.performance.now():

but I just today updated from Safari 7 to Safari 9 and big disappointment: window.performance is undefined!

Should it work? Does it work for someone? Is this problem with my OS and/or hardware?

Share asked Oct 4, 2015 at 19:18 Timo KähkönenTimo Kähkönen 12.2k10 gold badges78 silver badges115 bronze badges 3
  • Works fine for me, Safari 9, Yosemite. – kombucha Commented Oct 4, 2015 at 19:34
  • Does it give fractions? Test eg. here: jsbin./luxonuv/1/edit?js,output – Timo Kähkönen Commented Oct 4, 2015 at 19:40
  • It seems that I have to update to El Capitan? – Timo Kähkönen Commented Oct 4, 2015 at 19:48
Add a ment  | 

1 Answer 1

Reset to default 7

It was due to Mavericks. Safari 9 installed well on Mavericks, but for some reason performance.now() didn't work.

May be Apple will fix this bug in the next Safari update.

I installed El Capitan and it worked:

Here is my updated test page that uses performance.now() to measure function execution time: http://jsbin./qocojaducu/1/edit?js,output.

发布评论

评论列表(0)

  1. 暂无评论