A representation of a time interval.
More...
#include <monotime.h>
A representation of a time interval.
The MonoDelta class represents an elapsed duration of time – i.e. the delta between two MonoTime instances.
◆ MonoDelta()
kudu::MonoDelta::MonoDelta |
( |
| ) |
|
Build a MonoDelta object.
- Note
- A MonoDelta instance built with the this default constructor is "uninitialized" and may not be used for any operation.
◆ Equals()
bool kudu::MonoDelta::Equals |
( |
const MonoDelta & | rhs | ) |
const |
◆ FromMicroseconds()
MonoDelta kudu::MonoDelta::FromMicroseconds |
( |
int64_t | us | ) |
|
|
static |
- Parameters
-
[in] | us | Time interval representation in seconds (with ubiquitous SI prefixes). |
- Returns
- The resulting MonoDelta object initialized in accordance with the specified parameter.
◆ FromMilliseconds()
MonoDelta kudu::MonoDelta::FromMilliseconds |
( |
int64_t | ms | ) |
|
|
static |
- Parameters
-
[in] | ms | Time interval representation in seconds (with ubiquitous SI prefixes). |
- Returns
- The resulting MonoDelta object initialized in accordance with the specified parameter.
◆ FromNanoseconds()
MonoDelta kudu::MonoDelta::FromNanoseconds |
( |
int64_t | ns | ) |
|
|
static |
- Parameters
-
[in] | ns | Time interval representation in seconds (with ubiquitous SI prefixes). |
- Returns
- The resulting MonoDelta object initialized in accordance with the specified parameter.
◆ FromSeconds()
MonoDelta kudu::MonoDelta::FromSeconds |
( |
double | seconds | ) |
|
|
static |
- Parameters
-
[in] | seconds | Time interval representation in seconds (with ubiquitous SI prefixes). |
- Returns
- The resulting MonoDelta object initialized in accordance with the specified parameter.
◆ Initialized()
bool kudu::MonoDelta::Initialized |
( |
| ) |
const |
- Returns
true
iff this object is initialized.
◆ LessThan()
bool kudu::MonoDelta::LessThan |
( |
const MonoDelta & | rhs | ) |
const |
◆ MoreThan()
bool kudu::MonoDelta::MoreThan |
( |
const MonoDelta & | rhs | ) |
const |
◆ NanosToTimeSpec()
void kudu::MonoDelta::NanosToTimeSpec |
( |
int64_t | nanos, |
|
|
struct timespec * | ts ) |
|
static |
Convert a nanosecond value to a timespec.
- Parameters
-
[in] | nanos | Representation of a relative point in time in nanoseconds. |
[out] | ts | Placeholder for the resulting timespec representation. |
◆ operator+=()
Add a delta to current time interval.
- Parameters
-
[in] | delta | The delta to add. |
- Returns
- Reference to the modified object.
◆ operator-=()
Substract a delta from current time interval.
- Parameters
-
[in] | delta | The delta to substract. |
- Returns
- Reference to the modified object.
◆ ToMicroseconds()
int64_t kudu::MonoDelta::ToMicroseconds |
( |
| ) |
const |
- Returns
- Representation of the time interval in appropriate SI units.
◆ ToMilliseconds()
int64_t kudu::MonoDelta::ToMilliseconds |
( |
| ) |
const |
- Returns
- Representation of the time interval in appropriate SI units.
◆ ToNanoseconds()
int64_t kudu::MonoDelta::ToNanoseconds |
( |
| ) |
const |
- Returns
- Representation of the time interval in appropriate SI units.
◆ ToSeconds()
double kudu::MonoDelta::ToSeconds |
( |
| ) |
const |
- Returns
- Representation of the time interval in appropriate SI units.
◆ ToString()
std::string kudu::MonoDelta::ToString |
( |
| ) |
const |
- Returns
- String representation of this interval's duration (in seconds).
◆ ToTimeSpec()
void kudu::MonoDelta::ToTimeSpec |
( |
struct timespec * | ts | ) |
const |
Represent this time interval as a timespec structure, with nanosecond accuracy.
- Parameters
-
[out] | ts | Placeholder for the result value. |
◆ ToTimeVal()
void kudu::MonoDelta::ToTimeVal |
( |
struct timeval * | tv | ) |
const |
Represent this time interval as a timeval structure, with microsecond accuracy.
- Parameters
-
[out] | tv | Placeholder for the result value. |
The documentation for this class was generated from the following file: