|
CppTest
Version 2.0.0
|
#include <cpptest-time.h>
Public Member Functions | |
| Time () | |
| Time (unsigned int sec, unsigned int usec) | |
| unsigned int | seconds () const |
| unsigned int | microseconds () const |
Static Public Member Functions | |
| static Time | current () |
Friends | |
| Time | operator+ (const Time &t1, const Time &t2) |
| Time | operator- (const Time &t1, const Time &t2) |
| std::ostream & | operator<< (std::ostream &os, const Time &t) |
Related Functions | |
(Note that these are not member functions.) | |
| Time | operator- (const Time &t1, const Time &t2) |
| Time | operator+ (const Time &t1, const Time &t2) |
| ostream & | operator<< (ostream &os, const Time &t) |
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<<().
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. |
|
related |
Outputs a time to an output stream.
| os | Output stream to write to. |
| t | Time to output. |
References microseconds(), and seconds().
1.8.14