Time Class Reference
A time holding class.
More...
#include <yateclass.h>
List of all members.
Detailed Description
A time holding class.
The Time class holds a time moment with microsecond accuracy
Constructor & Destructor Documentation
Constructs a Time object from the current time
Time |
( |
u_int64_t |
usec |
) |
[inline] |
Constructs a Time object from a given time
- Parameters:
-
| usec | Time in microseconds |
Time |
( |
const struct timeval * |
tv |
) |
[inline] |
Constructs a Time object from a timeval structure pointer
- Parameters:
-
| tv | Pointer to the timeval structure |
Time |
( |
const struct timeval & |
tv |
) |
[inline] |
Constructs a Time object from a timeval structure
- Parameters:
-
| tv | Reference of the timeval structure |
Do-nothing destructor that keeps the compiler from complaining about inlining derivates or members of Time type
Member Function Documentation
u_int32_t sec |
( |
|
) |
const [inline] |
Get time in seconds
- Returns:
- Time in seconds since the Epoch
u_int64_t msec |
( |
|
) |
const [inline] |
Get time in milliseconds
- Returns:
- Time in milliseconds since the Epoch
u_int64_t usec |
( |
|
) |
const [inline] |
Get time in microseconds
- Returns:
- Time in microseconds since the Epoch
operator u_int64_t |
( |
|
) |
const [inline] |
Conversion to microseconds operator
Time& operator= |
( |
u_int64_t |
usec |
) |
[inline] |
Time& operator+= |
( |
int64_t |
delta |
) |
[inline] |
Time& operator-= |
( |
int64_t |
delta |
) |
[inline] |
void toTimeval |
( |
struct timeval * |
tv |
) |
const [inline] |
Fill in a timeval struct from a value in microseconds
- Parameters:
-
| 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
- Parameters:
-
| 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
- Parameters:
-
| tv | Pointer to the timeval structure |
- Returns:
- Corresponding time in microseconds or zero if tv is NULL
static u_int64_t fromTimeval |
( |
const struct timeval & |
tv |
) |
[inline, static] |
Convert time in a timeval struct to microseconds
- Parameters:
-
| tv | Reference of the timeval structure |
- Returns:
- Corresponding time in microseconds
static u_int64_t now |
( |
|
) |
[static] |
Get the current system time in microseconds
- Returns:
- Time in microseconds since the Epoch
static u_int64_t msecNow |
( |
|
) |
[static] |
static u_int32_t secNow |
( |
|
) |
[static] |
Get the current system time in seconds
- Returns:
- Time in seconds since the Epoch
The documentation for this class was generated from the following file: