C++ API Reference
|
MProfilingScope is used to profile code execution time. More...
#include <MProfiler.h>
Public Member Functions | |
MProfilingScope (int categoryId, MProfiler::ProfilingColor colorIndex, const char *eventName, const char *description=NULL, const MObject &associatedNode=MObject::kNullObj, MStatus *ReturnStatus=NULL) | |
====================================================================== Class constructor. More... | |
~MProfilingScope () | |
====================================================================== Class destructor. More... | |
Static Public Member Functions | |
static const char * | className () |
====================================================================== Returns the name of this class. More... | |
MProfilingScope is used to profile code execution time.
Profiling begins with the creation of an MProfilingScope instance and ends when the instance is destroyed (e.g. when it goes out of scope at the end of the block in which it was declared).
For example, if you want to profile any code snippet, you can instrument it like this:
When profilingScope is out of its life scope, the profiling stops.
You can also assign an associated node during the instrumentation, then all the profiling events generated from this instrumentation can benefit from the ability of the profiler view to select an associated dependency node for certain events.
MProfilingScope | ( | int | categoryId, |
MProfiler::ProfilingColor | colorIndex, | ||
const char * | eventName, | ||
const char * | description = NULL , |
||
const MObject & | associatedNode = MObject::kNullObj , |
||
MStatus * | ReturnStatus = NULL |
||
) |
====================================================================== Class constructor.
It begins the profiling.
[in] | categoryId | The index of the category which the event belongs to. |
[in] | colorIndex | The color to draw the profiling result in Profiler Window. |
[in] | eventName | The name of the event. |
[in] | description | Description of the event. |
[in] | associatedNode | The dependency node associated with the event. |
[out] | ReturnStatus | Status code. |
~MProfilingScope | ( | ) |
====================================================================== Class destructor.
It ends the profiling.
|
static |
====================================================================== Returns the name of this class.