NcEngine
Profile.h
Go to the documentation of this file.
1
5
#pragma once
6
7
#ifdef NC_PROFILING_ENABLED
8
9
#include "optick.h"
10
11
namespace
nc
12
{
14
using
ProfileCategory = Optick::Category;
15
17
namespace
detail
18
{
19
struct
TaskMeasurement
20
{
21
explicit
TaskMeasurement()
22
{
23
OPTICK_START_THREAD(
"NcEngine Worker"
);
24
}
25
26
~TaskMeasurement() noexcept
27
{
28
OPTICK_STOP_THREAD();
29
}
30
};
31
}
// namespace detail
32
}
// namespace nc
36
#define NC_PROFILE_SCOPE(name, category) OPTICK_CATEGORY(name, category);
37
39
#define NC_PROFILE_TASK(name, category) \
40
const auto _ncTaskMeasurement ## __LINE__ = nc::detail::TaskMeasurement{}; \
41
NC_PROFILE_SCOPE(name, category);
42
43
#else
44
#define NC_PROFILE_SCOPE(name, category)
45
#define NC_PROFILE_TASK(name, category)
46
#endif
include
ncengine
debug
Profile.h
Generated by
1.9.4