Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer 11 IE11 performance.now()返回无穷大_Internet Explorer 11 - Fatal编程技术网

Internet explorer 11 IE11 performance.now()返回无穷大

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的好处

我发现了一个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的好处(例如亚毫秒精度和单调递增的时钟),但是依赖于
性能的代码。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; }
  }
})();