CppTest home page CppTest project page

Test::Time Class Reference

Time representation. More...

#include <cpptest-time.h>

List of all members.

Public Member Functions

Static Public Member Functions

Friends

Related Functions

(Note that these are not member functions.)

Detailed Description

Time representation.

Encapsulates a time value with microsecond resolution. It is possible to retrieve the current time, add and subtract time values, and output the time to an output stream.


Constructor & Destructor Documentation

Test::Time::Time (  ) 

Constructs a time object with zeroed time.

Test::Time::Time ( unsigned int  sec,
unsigned int  usec 
)

Constructs a time object.

Parameters:
sec Seconds.
usec Micro-seconds.


Member Function Documentation

unsigned int Test::Time::seconds (  )  const

Returns:
Seconds.

unsigned int Test::Time::microseconds (  )  const

Returns:
Micro-seconds.

Time Test::Time::current (  )  [static]

Returns:
The current time.


Friends And Related Function Documentation

Time operator+ ( const Time t1,
const Time t2 
) [friend]

Adds two time values.

Parameters:
t1 Left-hand time.
t2 Right-hand time.
Returns:
Computed time value.

Time operator- ( const Time t1,
const Time t2 
) [friend]

Computes the time elapsed between two time values.

Parameters:
t1 Left-hand time, should be greater than t2.
t2 Right-hand time, should be less than t1.
Returns:
Computed time value.

ostream & operator<< ( ostream &  os,
const Time t 
) [related]

Outputs a time to an output stream.

Parameters:
os Output stream to write to.
t Time to output.
Returns:
A reference to the given output stream.


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

SourceForge Logo