Compare Revisions

JavaScript Profiler

Change Revisions

Revision 414189:

Revision 414189 by wbamberg on

Revision 414203:

Revision 414203 by wbamberg on

Title:
Profiler
Profiler
Slug:
Tools/Profiler
Tools/Profiler
Content:

Revision 414189
Revision 414203
n13    <h2>n13    <h2 id="Creating_a_profile">
n17      You can create a profile in one of two ways: using the Profn17      Click the "Start" button in the Profiler UI to start profil
>iler UI in the Toolbox, or programmatically from JavaScript.>ing, then the "Stop" button to stop profiling and save the new pr
 >ofile:
n20      To use the Profiler UI, click the "Start" button to start pn20      <img alt="" src="https://mdn.mozillademos.org/files/5303/pr
>rofiling, then the "Stop" button to stop profiling and save the n>ofiler-start-stop.png" style="width: 611px; height: 89px; display
>ew profile:>: block; margin-left: auto; margin-right: auto;">
t22    <p>t
23      <img alt="" src="https://mdn.mozillademos.org/files/5303/pr
>ofiler-start-stop.png" style="width: 611px; height: 89px; display 
>: block; margin-left: auto; margin-right: auto;">To create a prof 
>ile programmatically, call 
24    </p>
25    <pre>
26<span class="brush: js">console</span><span class="p">.</span><sp
>an class="nx">profile</span><span class="p">(</span><span class=" 
>s2">"detection"</span><span class="p">);</span> <span class="c1"> 
>// start a profile with name "detection"</span> 
27 
28<span class="nx">kittydar</span><span class="p">.</span><span cla
>ss="nx">detectCats</span><span class="p">(</span><span class="nx" 
>>canvas</span><span class="brush: js">);</span> 
29 
30<span class="nx">console</span><span class="p">.</span><span clas
>s="nx">profileEnd</span><span class="p">(</span><span class="s2"> 
>"detection"</span><span class="p">);</span> <span class="c1">// s 
>top profiling</span> 
31</pre>

Back to History