Nebula
Loading...
Searching...
No Matches
Debug::DebugTimer Class Reference

#include <debugtimer.h>

Detailed Description

A debug timer for measuring time spent in code blocks.

Inherits Core::RefCounted.

Public Member Functions

 DebugTimer ()
 constructor
 
virtual ~DebugTimer ()
 destructor
 
void Setup (const Util::StringAtom &timerName, const Util::StringAtom &group=Util::StringAtom("Ungrouped"))
 setup the timer
 
void Discard ()
 discard the timer
 
bool IsValid () const
 return true if this timer has been setup
 
void Start ()
 start or continue the timer
 
void Pause ()
 pause the timer
 
void Stop ()
 stop the timer, writes sample to history
 
void StartAccum ()
 start or continue the timer
 
void StopAccum ()
 stop the timer, writes sample to history
 
void ResetAccum ()
 stop the timer, writes sample to history
 
const Util::StringAtomGetName () const
 get the timer name
 
const Util::StringAtomGetGroup () const
 get the timer group
 
Timing::Time GetSample () const
 get the most current sample
 
Util::Array< Timing::TimeGetHistory () const
 get the timer's history
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Static Public Member Functions

static Ptr< DebugTimerCreateAsSingleton (const Util::StringAtom &timerName)
 create as singleton
 
static void DestroySingleton (const Util::StringAtom &timerName)
 create as singleton
 
- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 

Private Member Functions

 __DeclareClass (DebugTimer)
 

Private Attributes

Threading::CriticalSection critSect
 
Util::StringAtom name
 
Util::StringAtom group
 
Timing::Timer timer
 
Timing::Time accumTime
 
Timing::Time startTime
 
Timing::Time resultTime
 
Util::RingBuffer< Timing::Timehistory
 

Additional Inherited Members

- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Constructor & Destructor Documentation

◆ DebugTimer()

Debug::DebugTimer::DebugTimer ( )

constructor

◆ ~DebugTimer()

Debug::DebugTimer::~DebugTimer ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Debug::DebugTimer::__DeclareClass ( DebugTimer )
private

◆ CreateAsSingleton()

Ptr< DebugTimer > Debug::DebugTimer::CreateAsSingleton ( const Util::StringAtom & timerName)
static

create as singleton

◆ DestroySingleton()

void Debug::DebugTimer::DestroySingleton ( const Util::StringAtom & timerName)
static

create as singleton

◆ Discard()

void Debug::DebugTimer::Discard ( )

discard the timer

◆ GetGroup()

const Util::StringAtom & Debug::DebugTimer::GetGroup ( ) const
inline

get the timer group

◆ GetHistory()

Array< Timing::Time > Debug::DebugTimer::GetHistory ( ) const

get the timer's history

◆ GetName()

const Util::StringAtom & Debug::DebugTimer::GetName ( ) const
inline

get the timer name

◆ GetSample()

Timing::Time Debug::DebugTimer::GetSample ( ) const

get the most current sample

◆ IsValid()

bool Debug::DebugTimer::IsValid ( ) const
inline

return true if this timer has been setup

◆ Pause()

void Debug::DebugTimer::Pause ( )
inline

pause the timer

◆ ResetAccum()

void Debug::DebugTimer::ResetAccum ( )
inline

stop the timer, writes sample to history

◆ Setup()

void Debug::DebugTimer::Setup ( const Util::StringAtom & timerName,
const Util::StringAtom & group = Util::StringAtom("Ungrouped") )

setup the timer

◆ Start()

void Debug::DebugTimer::Start ( )
inline

start or continue the timer

◆ StartAccum()

void Debug::DebugTimer::StartAccum ( )
inline

start or continue the timer

◆ Stop()

void Debug::DebugTimer::Stop ( )
inline

stop the timer, writes sample to history

◆ StopAccum()

void Debug::DebugTimer::StopAccum ( )
inline

stop the timer, writes sample to history

Member Data Documentation

◆ accumTime

Timing::Time Debug::DebugTimer::accumTime
private

◆ critSect

Threading::CriticalSection Debug::DebugTimer::critSect
private

◆ group

Util::StringAtom Debug::DebugTimer::group
private

◆ history

Util::RingBuffer<Timing::Time> Debug::DebugTimer::history
private

◆ name

Util::StringAtom Debug::DebugTimer::name
private

◆ resultTime

Timing::Time Debug::DebugTimer::resultTime
private

◆ startTime

Timing::Time Debug::DebugTimer::startTime
private

◆ timer

Timing::Timer Debug::DebugTimer::timer
private

The documentation for this class was generated from the following files: