Class Index | File Index

Classes


Namespace R.debug.Profiler

A static JavaScript implementation of a simple profiler.
Defined in: debug.profiler.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
R.debug.Profiler.dump()
Dump the profiles that are currently in the stack to a debug window.
<static>  
R.debug.Profiler.enter(prof)
Add a profile monitor to the stack of running profiles.
<static>  
R.debug.Profiler.exit()
For every "enter", there needs to be a matching "exit" to tell the profiler to stop timing the contained code.
<static>  
R.debug.Profiler.resetProfiles()
Reset any currently running profiles and clear the stack.
<static>  
R.debug.Profiler.start()
Start the profiler.
<static>  
R.debug.Profiler.stop()
Stop the profiler, dumping whatever was being profiled.
<static>  
R.debug.Profiler.wireObjects(objArray)
Wire the objects in the array with profiling
Namespace Detail
R.debug.Profiler
Method Detail
<static> R.debug.Profiler.dump()
Dump the profiles that are currently in the stack to a debug window. The profile stack will be cleared after the dump.

<static> R.debug.Profiler.enter(prof)
Add a profile monitor to the stack of running profiles. A good way to profile code is to use the try/finally method so that the profile will be exited even if the method returns from multiple points.
 function func() {
      try {
         Profiler.enter("func");
         
         doStuff = doStuff + 1;
         return doStuff;
      } finally {
         Profiler.exit();
      }
   }
 
Parameters:
prof
{String} The name of the profile

<static> R.debug.Profiler.exit()
For every "enter", there needs to be a matching "exit" to tell the profiler to stop timing the contained code. Note that "exit" doesn't take any parameters. It is necessary that you properly balance your profile stack. Too many "exit" calls will result in a stack underflow. Missing calls to "exit" will result in a stack overflow.

<static> R.debug.Profiler.resetProfiles()
Reset any currently running profiles and clear the stack.

<static> R.debug.Profiler.start()
Start the profiler.

<static> R.debug.Profiler.stop()
Stop the profiler, dumping whatever was being profiled.

<static> R.debug.Profiler.wireObjects(objArray)
Wire the objects in the array with profiling
Parameters:
objArray
{Array} Object array

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Mar 18 2013 16:09:18 GMT-0400 (EDT)