Internet explorer 11 IE11 performance.now()返回无穷大
我发现了一个bug,Internet explorer 11 IE11 performance.now()返回无穷大,internet-explorer-11,Internet Explorer 11,我发现了一个bug,performance.now()API的IE 11返回Infinity。我注意到只有在设置以下注册表项时才会发生这种情况: [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main] "TabProcGrowth"=dword:00000000 我已经在Win10和服务器2016上重新编程了。有解决方法吗?您可以根据Date.now()使用自己的函数替换performance.now()。您将失去API的好处
performance.now()
API的IE 11返回Infinity
。我注意到只有在设置以下注册表项时才会发生这种情况:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main]
"TabProcGrowth"=dword:00000000
我已经在Win10和服务器2016上重新编程了。有解决方法吗?您可以根据
Date.now()
使用自己的函数替换performance.now()
。您将失去API的好处(例如亚毫秒精度和单调递增的时钟),但是依赖于性能的代码。now()
应该对更改漠不关心
// Run this as early as possible for the most accurate start time
(function() {
if(!isFinite(performance.now())) {
var start = Date.now();
performance.now = function() { return Date.now() - start; }
}
})();