# samples/common/classes/NvElementProfiler.cpp File Reference

`#include <iostream>`
`#include <string.h>`
`#include <map>`
`#include <stdint.h>`
`#include "NvElementProfiler.h"`

Go to the source code of this file.

## Defines

#define | LOCK() pthread_mutex_lock(&profiler_lock)
#define | UNLOCK() pthread_mutex_unlock(&profiler_lock)
#define | RETURN_IF_DISABLED()
#define | GET_TIME(timeval) gettimeofday(timeval, NULL);
#define | TIMESPEC_DIFF_USEC(timespec1, timespec2)

## Define Documentation

#define GET_TIME | ( | timeval |  | ) | gettimeofday(timeval, NULL);

Definition at line 44 of file NvElementProfiler.cpp.

#define LOCK | ( |  | ) | pthread_mutex_lock(&profiler_lock)

Definition at line 35 of file NvElementProfiler.cpp.

#define RETURN_IF_DISABLED | ( |  | ) |

Value:

    if (!enabled) { \
            UNLOCK(); \
            return; \
        }

Definition at line 38 of file NvElementProfiler.cpp.

#define TIMESPEC_DIFF_USEC | ( | timespec1,
|  | timespec2 |  | ) |

Value:

    (((timespec1)->tv_sec - (timespec2)->tv_sec) * 1000000L + \
            (timespec1)->tv_usec - (timespec2)->tv_usec)

Definition at line 46 of file NvElementProfiler.cpp.

#define UNLOCK | ( |  | ) | pthread_mutex_unlock(&profiler_lock)

Definition at line 36 of file NvElementProfiler.cpp.