CppTest home page | CppTest project page |
#include <cpptest-time.h>
(Note that these are not member functions.)
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.
Test::Time::Time | ( | ) |
Constructs a time object with zeroed time.
Referenced by current().
Test::Time::Time | ( | unsigned int | sec, |
unsigned int | usec | ||
) |
Constructs a time object.
sec | Seconds. |
usec | Micro-seconds. |
unsigned int Test::Time::seconds | ( | ) | const |
Referenced by operator<<().
unsigned int Test::Time::microseconds | ( | ) | const |
Referenced by operator<<().
Time Test::Time::current | ( | ) | [static] |
References Time().
Computes the time elapsed between two time values.
t1 | Left-hand time, should be greater than t2. |
t2 | Right-hand time, should be less than t1. |
Adds two time values.
t1 | Left-hand time. |
t2 | Right-hand time. |
ostream & operator<< | ( | ostream & | os, |
const Time & | t | ||
) | [related] |
Outputs a time to an output stream.
os | Output stream to write to. |
t | Time to output. |
References microseconds(), and seconds().