Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Profiler::Timer Class Reference

Measures the time that this class exists, reports result to a profiler. More...

#include <Profiler.h>


Detailed Description

Measures the time that this class exists, reports result to a profiler.

Don't bother trying to use this as a quick timer - just use TimeET directly. But there are functions to get the elapsed time and such if you insist.

Definition at line 129 of file Profiler.h.

List of all members.

Public Member Functions

 Timer ()
 constructor - starts timer, but you can restart it...
 Timer (unsigned int id, Profiler *prof)
 constructor - starts the timer, sets current timer in prof
 Timer (const Timer &t)
 copy constructor, not that you should need it, does same as default
Timeroperator= (const Timer &t)
 not that you should need it, does same as default
 ~Timer ()
 destructor - stops the timer, reports results
void setID (unsigned int id, Profiler *prof)
 sets the ID and profiler, also starts timer
void start ()
 starts timer (or resets it)
const TimeET & startTime ()
 returns time of start
TimeET elapsed ()
 returns time since start

Protected Attributes

Profiler_prof
 the profiler this should report to
unsigned int _id
 the id number for this code section (See example in beginning of class documentation for how these are assigned)
unsigned int _parent
 the id number of the timer this timer is under
TimeET _t
 the time this timer was created

Friends

class Profiler
 Profiler will need to read out some data that no one else should be depending on.

Constructor & Destructor Documentation

Profiler::Timer::Timer (  ) 

constructor - starts timer, but you can restart it...

Definition at line 133 of file Profiler.h.

Profiler::Timer::Timer ( unsigned int  id,
Profiler prof 
)

constructor - starts the timer, sets current timer in prof

Tells the profiler that this is now the active timer, so new timers will fit "under" this.
Timer isn't actually started here, lets Profiler::setCurrent do that.

Parameters:
prof profiler to report results to. If is NULL, does nothing.
id id number for this function. See Profiler::getNewID() for what you should pass this

Definition at line 19 of file Profiler.cc.

Profiler::Timer::Timer ( const Timer t  ) 

copy constructor, not that you should need it, does same as default

Definition at line 135 of file Profiler.h.

Profiler::Timer::~Timer (  ) 

destructor - stops the timer, reports results

Definition at line 24 of file Profiler.cc.


Member Function Documentation

TimeET Profiler::Timer::elapsed (  ) 

returns time since start

Definition at line 141 of file Profiler.h.

Referenced by Profiler::finished().

Timer& Profiler::Timer::operator= ( const Timer t  ) 

not that you should need it, does same as default

Definition at line 136 of file Profiler.h.

void Profiler::Timer::setID ( unsigned int  id,
Profiler prof 
)

sets the ID and profiler, also starts timer

Definition at line 29 of file Profiler.cc.

void Profiler::Timer::start (  ) 

starts timer (or resets it)

Definition at line 139 of file Profiler.h.

const TimeET& Profiler::Timer::startTime (  ) 

returns time of start

Definition at line 140 of file Profiler.h.


Friends And Related Function Documentation

friend class Profiler [friend]

Profiler will need to read out some data that no one else should be depending on.

Definition at line 131 of file Profiler.h.


Member Data Documentation

unsigned int Profiler::Timer::_id [protected]

the id number for this code section (See example in beginning of class documentation for how these are assigned)

Definition at line 144 of file Profiler.h.

Referenced by Profiler::finished(), operator=(), Profiler::setCurrent(), and setID().

unsigned int Profiler::Timer::_parent [protected]

the id number of the timer this timer is under

Definition at line 145 of file Profiler.h.

Referenced by Profiler::finished(), operator=(), and Profiler::setCurrent().

the profiler this should report to

Definition at line 143 of file Profiler.h.

Referenced by operator=(), setID(), Timer(), and ~Timer().

TimeET Profiler::Timer::_t [protected]

the time this timer was created

Definition at line 146 of file Profiler.h.

Referenced by elapsed(), operator=(), Profiler::setCurrent(), start(), and startTime().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3