19#if NEBULA_ENABLE_PROFILING
20#define _declare_timer(timer) Ptr<Debug::DebugTimer> timer;
21#define _declare_static_timer(timer) static Ptr<Debug::DebugTimer> timer;
22#define _setup_timer(timer) {timer = Debug::DebugTimer::Create(); timer->Setup(Util::StringAtom(#timer));}
23#define _setup_grouped_timer(timer, group) {timer = Debug::DebugTimer::Create(); timer->Setup(Util::StringAtom(#timer), group);}
24#define _setup_timer_singleton(timer) {timer = Debug::DebugTimer::CreateAsSingleton(Util::StringAtom(#timer));}
25#define _setup_timer_singleton_name(timer, timerName) {timer = Debug::DebugTimer::CreateAsSingleton(Util::StringAtom(#timerName));}
26#define _discard_timer_singleton(timer) {Debug::DebugTimer::DestroySingleton(Util::StringAtom(#timer));}
27#define _discard_timer(timer) timer->Discard(); timer = nullptr;
28#define _start_timer(timer) timer->Start();
29#define _pause_timer(timer) timer->Pause();
30#define _stop_timer(timer) timer->Stop();
31#define _start_accum_timer(timer) timer->StartAccum();
32#define _stop_accum_timer(timer) timer->StopAccum();
33#define _reset_accum_timer(timer) timer->ResetAccum();
35#define _declare_timer(timer)
36#define _setup_timer(timer)
37#define _setup_grouped_timer(timer, group)
38#define _discard_timer(timer)
39#define _start_timer(timer)
40#define _pause_timer(timer)
41#define _stop_timer(timer)
170 if (this->
timer.Running())
The common base class of Nebula.
Definition refcounted.h:38
A debug timer for measuring time spent in code blocks.
Definition debugtimer.h:48
Timing::Time startTime
Definition debugtimer.h:97
Timing::Timer timer
Definition debugtimer.h:95
__DeclareClass(DebugTimer)
Util::Array< Timing::Time > GetHistory() const
get the timer's history
Definition debugtimer.cc:94
virtual ~DebugTimer()
destructor
Definition debugtimer.cc:31
void Stop()
stop the timer, writes sample to history
Definition debugtimer.h:133
void Discard()
discard the timer
Definition debugtimer.cc:62
Timing::Time accumTime
Definition debugtimer.h:96
const Util::StringAtom & GetGroup() const
get the timer group
Definition debugtimer.h:198
void Start()
start or continue the timer
Definition debugtimer.h:115
Util::StringAtom group
Definition debugtimer.h:94
Timing::Time resultTime
Definition debugtimer.h:98
Timing::Time GetSample() const
get the most current sample
Definition debugtimer.cc:78
static void DestroySingleton(const Util::StringAtom &timerName)
create as singleton
Definition debugtimer.cc:121
Threading::CriticalSection critSect
Definition debugtimer.h:92
void StopAccum()
stop the timer, writes sample to history
Definition debugtimer.h:156
void Setup(const Util::StringAtom &timerName, const Util::StringAtom &group=Util::StringAtom("Ungrouped"))
setup the timer
Definition debugtimer.cc:43
const Util::StringAtom & GetName() const
get the timer name
Definition debugtimer.h:189
bool IsValid() const
return true if this timer has been setup
Definition debugtimer.h:106
Util::StringAtom name
Definition debugtimer.h:93
DebugTimer()
constructor
Definition debugtimer.cc:19
Util::RingBuffer< Timing::Time > history
Definition debugtimer.h:99
void Pause()
pause the timer
Definition debugtimer.h:124
void StartAccum()
start or continue the timer
Definition debugtimer.h:146
static Ptr< DebugTimer > CreateAsSingleton(const Util::StringAtom &timerName)
create as singleton
Definition debugtimer.cc:106
void ResetAccum()
stop the timer, writes sample to history
Definition debugtimer.h:168
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Critical section objects are used to protect a portion of code from parallel execution.
A timer object is the most basic object for time measurement.
Nebula's dynamic array class.
Definition array.h:60
A ring buffer stores up to a maximum number of elements in a circular fashion.
Definition ringbuffer.h:21
void Add(const TYPE &elm)
add an element to the ring buffer
Definition ringbuffer.h:316
A StringAtom.
Definition stringatom.h:22
bool IsValid() const
return true if valid (contains a non-empty string)
Definition stringatom.h:353
Definition corepagehandler.cc:13
double Time
the time datatype
Definition time.h:18