go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
tmr::Timer Class Reference

#include <elxTimer.h>

Inheritance diagram for tmr::Timer:
Inheritance graph
[legend]
Collaboration diagram for tmr::Timer:
Collaboration graph
[legend]

Public Types

typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef Timer Self
typedef Object Superclass
typedef std::vector
< std::vcl_size_t > 
TimeDHMSType

Public Member Functions

int ElapsedClockAndTime (void)
virtual const char * GetClassName () const
virtual double GetElapsedClock () const
virtual double GetElapsedClockSec () const
virtual double GetElapsedTime () const
virtual std::vcl_size_t GetElapsedTimeSec () const
virtual time_t GetStartTime () const
virtual time_t GetStopTime () const
const std::string & PrintElapsedClock (void)
const std::string & PrintElapsedClockSec (void)
const std::string & PrintElapsedTimeDHMS (void)
const std::string & PrintElapsedTimeSec (void)
const std::string & PrintStartTime (void)
const std::string & PrintStopTime (void)
void StartTimer (void)
int StopTimer (void)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 Timer ()
virtual ~Timer ()

Protected Attributes

clock_t m_ElapsedClock
double m_ElapsedClockSec
std::string m_ElapsedClockSecString
std::string m_ElapsedClockString
double m_ElapsedTime
TimeDHMSType m_ElapsedTimeDHMS
std::string m_ElapsedTimeDHMSString
std::vcl_size_t m_ElapsedTimeSec
std::string m_ElapsedTimeSecString
clock_t m_StartClock
time_t m_StartTime
std::string m_StartTimeString
clock_t m_StopClock
time_t m_StopTime
std::string m_StopTimeString

Private Member Functions

void operator= (const Self &)
 Timer (const Self &)

Detailed Description

A class to time the different parts of the registration.

This class is a wrap around ctime.h. It is used to time the registration, to get the time per iteration, or whatever.

For precise timings we use clock() or clock_gettime(). On Windows clock_gettime() does not exist. clock() seems to give accurate timings, also on multi-threaded systems. For GCC / linux we use clock_gettime(), since clock() reports erroneous results on linux on multi-threaded systems: it reports the elapsed time multiplied by the number of threads that have been used. Ugly #ifdefs are needed however, and elxCommon requires linking to the library rt, but on linux only.

Definition at line 67 of file elxTimer.h.


Member Typedef Documentation

typedef SmartPointer<const Self> tmr::Timer::ConstPointer

Definition at line 74 of file elxTimer.h.

typedef SmartPointer<Self> tmr::Timer::Pointer

Definition at line 73 of file elxTimer.h.

Standard ITK-stuff.

Definition at line 71 of file elxTimer.h.

typedef Object tmr::Timer::Superclass

Definition at line 72 of file elxTimer.h.

typedef std::vector<std::vcl_size_t> tmr::Timer::TimeDHMSType

My typedef's.

Definition at line 80 of file elxTimer.h.


Constructor & Destructor Documentation

tmr::Timer::Timer ( ) [protected]
virtual tmr::Timer::~Timer ( ) [inline, protected, virtual]

Definition at line 112 of file elxTimer.h.

tmr::Timer::Timer ( const Self ) [private]

Member Function Documentation

virtual const char* tmr::Timer::GetClassName ( ) const [virtual]

Run-time type information (and related methods).

virtual double tmr::Timer::GetElapsedClock ( ) const [virtual]
virtual double tmr::Timer::GetElapsedClockSec ( ) const [virtual]
virtual double tmr::Timer::GetElapsedTime ( ) const [virtual]
virtual std:: vcl_size_t tmr::Timer::GetElapsedTimeSec ( ) const [virtual]
virtual time_t tmr::Timer::GetStartTime ( ) const [virtual]

Communication with outside world.

virtual time_t tmr::Timer::GetStopTime ( ) const [virtual]
static Pointer tmr::Timer::New ( ) [static]

Method for creation through the object factory.

void tmr::Timer::operator= ( const Self ) [private]
const std::string& tmr::Timer::PrintElapsedClock ( void  )
const std::string& tmr::Timer::PrintElapsedClockSec ( void  )
const std::string& tmr::Timer::PrintElapsedTimeDHMS ( void  )
const std::string& tmr::Timer::PrintElapsedTimeSec ( void  )
const std::string& tmr::Timer::PrintStartTime ( void  )

Formatted Output Functions (return the time as a string, with comments)

const std::string& tmr::Timer::PrintStopTime ( void  )
void tmr::Timer::StartTimer ( void  )

Member functions.


Field Documentation

clock_t tmr::Timer::m_ElapsedClock [protected]

Definition at line 120 of file elxTimer.h.

Definition at line 123 of file elxTimer.h.

std::string tmr::Timer::m_ElapsedClockSecString [protected]

Definition at line 138 of file elxTimer.h.

std::string tmr::Timer::m_ElapsedClockString [protected]

Definition at line 137 of file elxTimer.h.

Definition at line 119 of file elxTimer.h.

Definition at line 121 of file elxTimer.h.

std::string tmr::Timer::m_ElapsedTimeDHMSString [protected]

Definition at line 135 of file elxTimer.h.

std::vcl_size_t tmr::Timer::m_ElapsedTimeSec [protected]

Definition at line 122 of file elxTimer.h.

std::string tmr::Timer::m_ElapsedTimeSecString [protected]

Definition at line 136 of file elxTimer.h.

clock_t tmr::Timer::m_StartClock [protected]

Definition at line 116 of file elxTimer.h.

time_t tmr::Timer::m_StartTime [protected]

Variables that store program arguments.

Definition at line 112 of file elxTimer.h.

std::string tmr::Timer::m_StartTimeString [protected]

GCC specific. We can use clock_gettime(). Strings that serve as output of the Formatted Output Functions

Definition at line 133 of file elxTimer.h.

clock_t tmr::Timer::m_StopClock [protected]

Definition at line 118 of file elxTimer.h.

time_t tmr::Timer::m_StopTime [protected]

Definition at line 117 of file elxTimer.h.

std::string tmr::Timer::m_StopTimeString [protected]

Definition at line 134 of file elxTimer.h.



Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo