如何在页面加载时启动Firebug的性能分析器?

时间:2014-10-14 09:48:21

标签: javascript performance profiling firebug

所以,Firebug有一个我以前从未注意到的JavaScript性能分析器......

pic of the Firebug profiler button

现在我想用它来解决页面加载性能问题,但是我不能足够快地按下按钮!当然,从一开始就可以对页面进行分析?

1 个答案:

答案 0 :(得分:8)

Firebug wiki表示您可以使用简单的javascript console.profile执行此操作 所以在你的html页面中你可以这样做:

console.profile("Your new profiler");
alert('Open firebug profiles tab to see result');    
console.profileEnd();