Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

UnixTimer Class Reference

Inheritance diagram for UnixTimer:

Inheritance graph
Collaboration diagram for UnixTimer:

Collaboration graph
List of all members.

Public Member Functions

double getTime () const
void reset ()
 UnixTimer ()
 ~UnixTimer ()

Private Attributes

double start

Constructor & Destructor Documentation

UnixTimer::UnixTimer  ) 
 

Definition at line 28 of file unixtimer.cpp.

References reset().

00029 {
00030     reset();
00031 }

UnixTimer::~UnixTimer  ) 
 

Definition at line 33 of file unixtimer.cpp.

00034 {
00035 }


Member Function Documentation

double UnixTimer::getTime  )  const [virtual]
 

Implements Timer.

Definition at line 37 of file unixtimer.cpp.

References start.

00038 {
00039     struct timeval t;
00040     gettimeofday(&t, NULL);
00041     return (double) t.tv_sec + (double) t.tv_usec / 1000000.0 - start;
00042 }

void UnixTimer::reset  )  [virtual]
 

Implements Timer.

Definition at line 44 of file unixtimer.cpp.

References start.

Referenced by UnixTimer().

00045 {
00046     struct timeval t;
00047     gettimeofday(&t, NULL);
00048     start = (double) t.tv_sec + (double) t.tv_usec / 1000000.0;
00049 }


Member Data Documentation

double UnixTimer::start [private]
 

Definition at line 24 of file unixtimer.cpp.

Referenced by getTime(), and reset().


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:40 2006 for Celestia by  doxygen 1.4.1