Javascript Profiling: Difference between revisions

Jump to navigation Jump to search
m
Line 7: Line 7:
Here's a rough idea of what the API would be like from the javascript side of things:
Here's a rough idea of what the API would be like from the javascript side of things:


* <tt>profiler.start() : unit &rarr; unit</tt> - This beings profiling the current page, setting up all necessary internal information. Throws an error if profiling has already been started.
* <tt>profiler.start() : unit &rarr; unit</tt> - This begins profiling the current page, setting up all necessary internal information. Throws an error if profiling has already been started.
* <tt>profiler.running() : unit &rarr; bool</tt> - Tests whether the profiler is currently running, returning <tt>true</tt> if it is or <tt>false</tt> otherwise.
* <tt>profiler.running() : unit &rarr; bool</tt> - Tests whether the profiler is currently running, returning <tt>true</tt> if it is or <tt>false</tt> otherwise.
* <tt>proflier.event(a) : object &rarr; unit</tt> - Fires a custom profiling event from javascript, the provided object is used to identify the event. Throws an error if profiling is not currently running.
* <tt>profiler.event(a) : object &rarr; unit</tt> - Fires a custom profiling event from Javascript. The provided object is used to identify the event. Throws an error if profiling is not currently running.
* <tt>proflier.end() : unit &rarr; stack list</tt> - Finishes the profiling process, cleaning up all internal state. The returned array is a list of <tt>stack</tt> objects (described below). Throws an error if profiling is not currently running.
* <tt>profiler.end() : unit &rarr; stack list</tt> - Finishes the profiling process, cleaning up all internal state. The returned array is a list of <tt>stack</tt> objects (described below). Throws an error if profiling is not currently running.


== The <tt>stack</tt> object ==
== The <tt>stack</tt> object ==
Confirmed users
497

edits

Navigation menu