22 #ifndef _XN_PROFILING_H_
23 #define _XN_PROFILING_H_
33 #define INVALID_PROFILING_HANDLE -1
96 #define _XN_PROFILING_START_SECTION(name, mt) \
98 static XnProfilingHandle __profiling = INVALID_PROFILING_HANDLE; \
99 if (xnProfilingIsActive()) \
101 xnProfilingSectionStart(name, mt, &__profiling); \
104 #define XN_PROFILING_START_SECTION(name) _XN_PROFILING_START_SECTION(name, FALSE)
105 #define XN_PROFILING_START_MT_SECTION(name) _XN_PROFILING_START_SECTION(name, TRUE)
110 #define XN_PROFILING_END_SECTION \
111 if (__profiling != INVALID_PROFILING_HANDLE) \
113 xnProfilingSectionEnd(&__profiling); \
124 #define XN_PROFILING_START_FUNCTION XN_PROFILING_START_SECTION(__FUNCTION__)
129 #define XN_PROFILING_END_FUNCTION XN_PROFILING_END_SECTION
131 #endif //_XN_PROFILING_H_