Add documentation of the JS hooks
authorbzbarsky@mit.edu
Thu, 06 Dec 2007 09:04:56 -0800
changeset 8794 60903a5c45c4ff470d2442fdcc08d40719e3011b
parent 8793 e785a936a4915a6ee0a97612487df43f63b687ee
child 8795 ad0151c64ee052b3c40ed2477e60c25828608154
push idunknown
push userunknown
push dateunknown
milestone1.9b2pre
Add documentation of the JS hooks
tools/jprof/README.html
--- a/tools/jprof/README.html
+++ b/tools/jprof/README.html
@@ -82,16 +82,24 @@ which have the following meanings:
     at which the timer should fire, measured in Hz. It must be a power of 2.
     The maximal frequency allowed by the kernel can be changed by writing to
     <code>/proc/sys/dev/rtc/max-user-freq</code>; the maximum value it can be
     set to is 8192.  Note that <code>/dev/rtc</code> will need to be readable
     by the Firefox process; making that file world-readable is a simple way to
     accomplish that.
 </ul>
 
+<h4>Starting and stopping jprof from JavaScript</h4>
+<p>
+A build with jprof enabled adds two functions to the Window object:
+<code>JProfStartProfiling()</code> and <code>JProfStopProfiling()</code>.  When used with JP_DEFER, these
+allow one to start and stop the timer just around whatever critical section is
+being profiled
+</p>
+
 <h4>Examples of JPROF_FLAGS usage</h4>
 <ul>
 
   <li>To make the timer start firing 3 seconds after the program is started and
   fire every 25 milliseconds of program time use:
     <pre>
         setenv JPROF_FLAGS "JP_START JP_FIRST=3 JP_PERIOD=0.025" </pre>