#include <yateclass.h>
Public Member Functions | |
Time () | |
Time (u_int64_t usec) | |
Time (const struct timeval *tv) | |
Time (const struct timeval &tv) | |
~Time () | |
u_int32_t | sec () const |
u_int64_t | msec () const |
u_int64_t | usec () const |
operator u_int64_t () const | |
Time & | operator= (u_int64_t usec) |
Time & | operator+= (int64_t delta) |
Time & | operator-= (int64_t delta) |
void | toTimeval (struct timeval *tv) const |
Static Public Member Functions | |
static void | toTimeval (struct timeval *tv, u_int64_t usec) |
static u_int64_t | fromTimeval (const struct timeval *tv) |
static u_int64_t | fromTimeval (const struct timeval &tv) |
static u_int64_t | now () |
static u_int64_t | msecNow () |
static u_int32_t | secNow () |
The Time class holds a time moment with microsecond accuracy
Time | ( | u_int64_t | usec | ) | [inline] |
Time | ( | const struct timeval * | tv | ) | [inline] |
Constructs a Time object from a timeval structure pointer
tv | Pointer to the timeval structure |
Time | ( | const struct timeval & | tv | ) | [inline] |
Constructs a Time object from a timeval structure
tv | Reference of the timeval structure |
~Time | ( | ) | [inline] |
Do-nothing destructor that keeps the compiler from complaining about inlining derivates or members of Time type
u_int32_t sec | ( | ) | const [inline] |
Get time in seconds
u_int64_t msec | ( | ) | const [inline] |
Get time in milliseconds
u_int64_t usec | ( | ) | const [inline] |
Get time in microseconds
operator u_int64_t | ( | ) | const [inline] |
Conversion to microseconds operator
Time& operator= | ( | u_int64_t | usec | ) | [inline] |
Assignment operator.
Time& operator+= | ( | int64_t | delta | ) | [inline] |
Offsetting operator.
Time& operator-= | ( | int64_t | delta | ) | [inline] |
Offsetting operator.
void toTimeval | ( | struct timeval * | tv | ) | const [inline] |
Fill in a timeval struct from a value in microseconds
tv | Pointer to the timeval structure |
static void toTimeval | ( | struct timeval * | tv, | |
u_int64_t | usec | |||
) | [static] |
Fill in a timeval struct from a value in microseconds
tv | Pointer to the timeval structure | |
usec | Time to convert to timeval |
static u_int64_t fromTimeval | ( | const struct timeval * | tv | ) | [static] |
Convert time in a timeval struct to microseconds
tv | Pointer to the timeval structure |
static u_int64_t fromTimeval | ( | const struct timeval & | tv | ) | [inline, static] |
Convert time in a timeval struct to microseconds
tv | Reference of the timeval structure |
static u_int64_t now | ( | ) | [static] |
Get the current system time in microseconds
static u_int64_t msecNow | ( | ) | [static] |
Get the current system time in milliseconds
static u_int32_t secNow | ( | ) | [static] |
Get the current system time in seconds