XnProfiling.h File Reference
`#include <XnOS.h>`

Go to the source code of this file.

## Macros

#define | INVALID_PROFILING_HANDLE -1
#define | XN_PROFILING_START_SECTION(name)
#define | XN_PROFILING_START_MT_SECTION(name)
#define | XN_PROFILING_END_SECTION
#define | XN_PROFILING_START_FUNCTION XN_PROFILING_START_SECTION(__FUNCTION__)
#define | XN_PROFILING_END_FUNCTION XN_PROFILING_END_SECTION

## Typedefs

typedef XnInt32 | XnProfilingHandle

## Functions

XN_C_API XnStatus XN_C_DECL | xnProfilingInit (XnUInt32 nProfilingInterval=0)
XN_C_API XnStatus XN_C_DECL | xnProfilingInitFromINI (const XnChar *cpINIFileName, const XnChar *cpSectionName)
XN_C_API XnStatus XN_C_DECL | xnProfilingShutdown ()
XN_C_API XnBool XN_C_DECL | xnProfilingIsActive ()
XN_C_API XnStatus XN_C_DECL | xnProfilingSectionStart (const char *csSectionName, XnBool bMT, XnProfilingHandle *pHandle)
XN_C_API XnStatus XN_C_DECL | xnProfilingSectionEnd (XnProfilingHandle *pHandle)

## Macro Definition Documentation

## INVALID_PROFILING_HANDLE

#define INVALID_PROFILING_HANDLE -1

## XN_PROFILING_END_FUNCTION

#define XN_PROFILING_END_FUNCTION XN_PROFILING_END_SECTION

Ends a profiled function.

## XN_PROFILING_END_SECTION

#define XN_PROFILING_END_SECTION

Value:
if (__profiling != INVALID_PROFILING_HANDLE) \
{ \
xnProfilingSectionEnd(&__profiling); \
} \
}
INVALID_PROFILING_HANDLE
#define INVALID_PROFILING_HANDLE
Definition XnProfiling.h:33

Ends a profiled section.

## XN_PROFILING_START_FUNCTION

#define XN_PROFILING_START_FUNCTION XN_PROFILING_START_SECTION(__FUNCTION__)

Starts a profiled section, giving it the name of the current function. The code section between this declaration and the following XN_PROFILING_END_FUNCTION declaration will be time-measured.

Parameters

  name | [in] The name of the section (for printing purposes).

## XN_PROFILING_START_MT_SECTION

#define XN_PROFILING_START_MT_SECTION | ( |  | name | ) |

Value:
_XN_PROFILING_START_SECTION(name, TRUE)
TRUE
#define TRUE
Definition XnPlatform.h:96

## XN_PROFILING_START_SECTION

#define XN_PROFILING_START_SECTION | ( |  | name | ) |

Value:
_XN_PROFILING_START_SECTION(name, FALSE)
FALSE
#define FALSE
Definition XnPlatform.h:100

## Typedef Documentation

## XnProfilingHandle

typedef XnInt32 XnProfilingHandle

## Function Documentation

## xnProfilingInit()

XN_C_API XnStatus XN_C_DECL xnProfilingInit | ( | XnUInt32 | nProfilingInterval = 0 | ) |

Initializes profiling.

Parameters

  nProfilingInterval | [in] The number of milliseconds between profiler printings. A value of zero means profiling is off.

## xnProfilingInitFromINI()

XN_C_API XnStatus XN_C_DECL xnProfilingInitFromINI | ( | const XnChar * | cpINIFileName,
|  | const XnChar * | cpSectionName )

Initializes using INI file.

Parameters

  cpINIFileName | [in] Name of INI file.
  cpSectionName | [in] Name of section in INI file.

## xnProfilingIsActive()

XN_C_API XnBool XN_C_DECL xnProfilingIsActive | ( |  | ) |

Returns TRUE if profiling is active, or FALSE otherwise.

## xnProfilingSectionEnd()

XN_C_API XnStatus XN_C_DECL xnProfilingSectionEnd | ( | XnProfilingHandle * | pHandle | ) |

Ends a profiled section. This function is not meant to be used directly. Please use the XN_PROFILING_END_SECTION macro.

Parameters

  pHandle | [in] A handle returned from xnProfilingSectionStart.

## xnProfilingSectionStart()

XN_C_API XnStatus XN_C_DECL xnProfilingSectionStart | ( | const char * | csSectionName,
|  | XnBool | bMT,
|  | XnProfilingHandle * | pHandle )

Start a profiled section. This function is not meant to be used directly. Please use the XN_PROFILING_START_SECTION macro.

Parameters

  csSectionName | [in] The name of the profiled section.
  bMT | [in] TRUE if this section is multi-threaded, FALSE otherwise.
  pHandle | [out] A handle to be used each time this section executes again.

## xnProfilingShutdown()

XN_C_API XnStatus XN_C_DECL xnProfilingShutdown | ( |  | ) |

Shuts down profiling.