Kudu C++ client API
|
Representation of a particular point in time. More...
#include <monotime.h>
Public Member Functions | |
MonoTime () KUDU_MONOTIME_NOEXCEPT | |
bool | Initialized () const |
MonoDelta | GetDeltaSince (const MonoTime &rhs) const |
void | AddDelta (const MonoDelta &delta) |
bool | ComesBefore (const MonoTime &rhs) const |
std::string | ToString () const |
void | ToTimeSpec (struct timespec *ts) const |
bool | Equals (const MonoTime &other) const |
Syntactic sugar: increment/decrement operators for MonoTime. | |
MonoTime & | operator+= (const MonoDelta &delta) |
MonoTime & | operator-= (const MonoDelta &delta) |
Static Public Member Functions | |
static MonoTime | Now () |
static MonoTime | Max () |
static MonoTime | Min () |
static const MonoTime & | Earliest (const MonoTime &a, const MonoTime &b) |
Static Public Attributes | |
Conversion constants for ubiquitous time units. | |
static const int64_t | kNanosecondsPerSecond = 1000000000L |
Nanoseconds per second. | |
static const int64_t | kNanosecondsPerMillisecond = 1000000L |
Nanoseconds per millisecond. | |
static const int64_t | kNanosecondsPerMicrosecond = 1000L |
Nanoseconds per microseconds. | |
static const int64_t | kMicrosecondsPerSecond = 1000000L |
Microseconds per second. | |
Representation of a particular point in time.
The MonoTime class represents a particular point in time, relative to some fixed but unspecified reference point.
This time is monotonic, meaning that if the user changes his or her system clock, the monotime does not change.
kudu::MonoTime::MonoTime | ( | ) |
Build a MonoTime object. The resulting object is not initialized and not ready to use.
void kudu::MonoTime::AddDelta | ( | const MonoDelta & | delta | ) |
Advance this object's time specification by the specified interval.
[in] | delta | The time interval to add. |
bool kudu::MonoTime::ComesBefore | ( | const MonoTime & | rhs | ) | const |
Select the earliest between the specified time points.
use
std::min() instead.[in] | a | The first MonoTime object to select from. |
[in] | b | The second MonoTime object to select from. |
bool kudu::MonoTime::Equals | ( | const MonoTime & | other | ) | const |
Compute time interval between the point in time specified by this and the specified object.
kudu::operator-(const MonoTime&, const MonoTime&)
instead.[in] | rhs | The object that corresponds to the left boundary of the time interval, where this object corresponds to the right boundary of the interval. |
bool kudu::MonoTime::Initialized | ( | ) | const |
true
iff the object is initialized.
|
static |
|
static |
|
static |
Get current time in MonoTime representation.
Add a delta to the point in time represented by the object.
[in] | delta | The delta to add. |
Substract a delta from the point in time represented by the object.
[in] | delta | The delta to substract. |
std::string kudu::MonoTime::ToString | ( | ) | const |
void kudu::MonoTime::ToTimeSpec | ( | struct timespec * | ts | ) | const |
Represent this point in time as a timespec structure, with nanosecond accuracy.
[out] | ts | Placeholder for the result value. |