CppTest home page CppTest project page

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

Test::Time Class Reference

Time representation. More...

#include <cpptest-time.h>

List of all members.

Public Member Functions

Static Public Member Functions

Friends


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<< std::ostream &  os,
const Time t
[friend]
 

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