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.com/2015/09/30/apple-releases-safari-9-for-yosemite-users/
caniuse.com/#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?
The performance. now() method returns a DOMHighResTimeStamp , measured in milliseconds. The returned value represents the time elapsed since the time origin.
There's no way to reset performance. now() . What you can do is to save current performance. now() when the timer starts and just substract it afterwards.
performance. now() has full support in all modern browsers, starting from Chrome 24, Firefox 15, and IE10.
It's purely dependent on the time since the code started running, and clock changes do not affect the time. It's also more accurate: counting us (microseconds) instead of ms. As for support, Date. now() has slightly more support than performance.
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.com/qocojaducu/1/edit?js,output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With