Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Clock Class Reference

Clock class. More...

#include <clock.hpp>

Inheritance diagram for Clock:

Inheritance graph
[legend]
Collaboration diagram for Clock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Clock ()
 Constructor.
 ~Clock ()
 Destructor.
void getClock (timespec &)
 Get time and write it to a timspec structure.
void zeroClock ()
void calculateClockResolution (timespec &)
 Calculate the resolution of the clock.

Protected Attributes

timespec zero

Detailed Description

Clock class.

This class is used for measuring time in PTF. The implementation tries to use the best timer available for the system. On Linux the POSIX realtime clock is used. On MacOS X it is the Mach timer.

Definition at line 30 of file clock.hpp.


Constructor & Destructor Documentation

Clock::Clock  ) 
 

Constructor.

Definition at line 64 of file clock.cpp.

References calculateClockResolution(), PtfCore::getMessageLog(), Singleton< PtfCore >::getSingleton(), MESSAGE, and WARNING.

Here is the call graph for this function:

Clock::~Clock  ) 
 

Destructor.

Definition at line 93 of file clock.cpp.


Member Function Documentation

void Clock::calculateClockResolution timespec &  tspec  ) 
 

Calculate the resolution of the clock.

Most systems report a false clock resolution. So here it is calculated. The resolution is the value that is added when the clock changes.

Parameters:
tspec a timespec structure which will store the clock resolution
Definition at line 136 of file clock.cpp.

References getClock().

Referenced by Clock().

Here is the call graph for this function:

void Clock::getClock timespec &  tspec  ) 
 

Get time and write it to a timspec structure.

Parameters:
tspec timspec structure which the time will be written to
Definition at line 102 of file clock.cpp.

References PtfCore::getMessageLog(), and Singleton< PtfCore >::getSingleton().

Referenced by calculateClockResolution(), TimeInterval::measureA(), and TimeInterval::measureB().

Here is the call graph for this function:

void Clock::zeroClock  ) 
 


Member Data Documentation

timespec Clock::zero [protected]
 

Definition at line 32 of file clock.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 14:54:28 2004 for Psychological Test Framework by doxygen 1.3.8