<!DOCTYPE html> <html> <header> <title>test</title> </header> <body> <h1>test</h1> </body> <script> setInterval(function() { var startTime = performance.now(); // 设置断点 debugger; var endTime = performance.now(); // 设置一个阈值,例如100毫秒 if (endTime - startTime > 100) { window.location.href = 'about:blank'; } }, 100); </script> </html>
标签:Debugger,startTime,跳转,var,performance,100,断点 From: https://www.cnblogs.com/zhulongxu/p/18112960