Duration Class Reference

#include <Duration.h>

List of all members.

Public Member Functions

 Duration ()
virtual ~Duration ()
void Start (void)
void Stop (void)
double GetDuration (void) const
double GetDurationInMs (void) const

Protected Attributes

TIMEVAL m_liStart
TIMEVAL m_liStop


Detailed Description

Definition at line 29 of file Duration.h.


Constructor & Destructor Documentation

Duration::Duration  )  [inline]
 

Definition at line 56 of file Duration.h.

References m_liStart, m_liStop, Start(), and Stop().

00057 {
00058 #ifdef WIN32
00059         LARGE_INTEGER liFrequency;
00060 
00061         QueryPerformanceFrequency(&liFrequency);
00062         m_llFrequency = liFrequency.QuadPart;
00063         
00064         // Calibration
00065         Start();
00066         Stop();
00067 
00068         m_llCorrection = m_liStop.QuadPart-m_liStart.QuadPart;
00069 #else
00070         // Calibration
00071 //      Start();
00072 //      Stop();
00073 
00074 //      m_llCorrection = GetDuration();
00075 #endif
00076 }

Here is the call graph for this function:

virtual Duration::~Duration  )  [inline, virtual]
 

Definition at line 33 of file Duration.h.

00033 {};


Member Function Documentation

double Duration::GetDuration void   )  const [inline]
 

Definition at line 102 of file Duration.h.

References ELAPSED_TIME_SEC, m_liStart, and m_liStop.

00103 {
00104 #ifdef WIN32
00105         return (double)(m_liStop.QuadPart-m_liStart.QuadPart-m_llCorrection)*1000000.0 / m_llFrequency; 
00106 #else
00107         return ELAPSED_TIME_SEC(m_liStart, m_liStop);
00108 #endif
00109 }

double Duration::GetDurationInMs void   )  const [inline]
 

not sure !!!

Definition at line 111 of file Duration.h.

References ELAPSED_TIME_SEC, m_liStart, and m_liStop.

00112 {
00113 #ifdef WIN32
00114         return (double)(m_liStop.QuadPart-m_liStart.QuadPart-m_llCorrection)*1000000.0 / m_llFrequency /1000.0; 
00115 #else
00116         return ELAPSED_TIME_SEC(m_liStart, m_liStop)*1000.0;  
00117 #endif
00118 }

void Duration::Start void   )  [inline]
 

Definition at line 78 of file Duration.h.

References GET_TIME, and m_liStart.

Referenced by Duration().

00079 {
00080 
00081 #ifdef WIN32
00082         // Ensure we will not be interrupted by any other thread for a while
00083         Sleep(0);
00084         QueryPerformanceCounter(&m_liStart);
00085 #else
00086         GET_TIME(m_liStart);
00087 #endif
00088 
00089 
00090 }

void Duration::Stop void   )  [inline]
 

Definition at line 92 of file Duration.h.

References GET_TIME, and m_liStop.

Referenced by Duration().

00093 {
00094 #ifdef WIN32
00095         QueryPerformanceCounter(&m_liStop);
00096 #else
00097         GET_TIME(m_liStop);
00098 #endif
00099 
00100 }


Member Data Documentation

TIMEVAL Duration::m_liStart [protected]
 

Definition at line 49 of file Duration.h.

Referenced by Duration(), GetDuration(), GetDurationInMs(), and Start().

TIMEVAL Duration::m_liStop [protected]
 

Definition at line 50 of file Duration.h.

Referenced by Duration(), GetDuration(), GetDurationInMs(), and Stop().


The documentation for this class was generated from the following file:
Generated on Fri Jul 10 10:32:15 2009 for Utils Library by  doxygen 1.4.5