Public Member Functions |
|
| TimeVal () |
| | Default constructor.
|
| | TimeVal (int32_t sec, int32_t usec) |
| | Constructor for given seconds and microseconds.
|
| | TimeVal (const timeval &timeval) |
| | Constructor for given "struct timeval".
|
| | TimeVal (const double &d) |
| | Constructor for given double-float time value.
|
| int32_t | sec () const |
| | Get the number of seconds.
|
| int32_t | usec () const |
| | Get the number of microseconds.
|
| string | str () const |
| string | pretty_print () const |
| | Pretty print the time.
|
| size_t | copy_in (const timeval &timeval) |
| | Copy the time value from a timeval structure.
|
| size_t | copy_out (timeval &timeval) const |
| | Copy the time value to a timeval structure.
|
| int64_t | to_ms () const |
| | Return an int64_t containing the total number of milliseconds in the underlying structure.
|
|
void | set_ms (int64_t ms) |
| double | get_double () const |
| | Convert a TimeVal value to a double-float value.
|
|
TimeVal & | operator= (const TimeVal &other) |
| | Assignment Operator.
|
| bool | operator== (const TimeVal &other) const |
| | Equality Operator.
|
| bool | operator< (const TimeVal &other) const |
| | Less-Than Operator.
|
| const TimeVal & | operator+= (const TimeVal &delta) |
| | Assign-Sum Operator.
|
| TimeVal | operator+ (const TimeVal &other) const |
| | Addition Operator.
|
| const TimeVal & | operator-= (const TimeVal &delta) |
| | Assign-Difference Operator.
|
| TimeVal | operator- (const TimeVal &other) const |
| | Substraction Operator.
|
| TimeVal | operator* (int n) const |
| | Multiplication Operator for integer operand.
|
| TimeVal | operator* (unsigned int n) const |
| | Multiplication Operator for unsigned integer operand.
|
| TimeVal | operator* (const double &d) const |
| | Multiplication Operator for double float operand.
|
| TimeVal | operator/ (int n) const |
| | Division Operator for integer operand.
|
| TimeVal | operator/ (unsigned int n) const |
| | Division Operator for unsigned integer operand.
|
| TimeVal | operator/ (const double &d) const |
| | Division Operator for double-float operand.
|
| bool | is_zero () const |
| | Test if this time value is numerically zero.
|
Static Public Member Functions |
|
static TimeVal | ZERO () |
| | Get zero value.
|
|
static TimeVal | MAXIMUM () |
| | Get the maximum permitted value.
|
|
static TimeVal | MINIMUM () |
| | Get the minimum permitted value.
|
Static Public Attributes |
|
static const int32_t | ONE_MILLION = 1000000 |
|
static const int32_t | ONE_THOUSAND = 1000 |
Private Member Functions |
|
| TimeVal (int i) |
Private Attributes |
|
int32_t | _sec |
|
int32_t | _usec |
TimeVal class.
TimeVal class is used for storing time value. Similar to "struct timeval", the time value is in seconds and microseconds.