|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Low-level time utilities using POSIX timespec. More...
#include <sys/time.h>#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | MSEC 1000 |
| #define | USEC 1000000 |
| #define | NSEC 1000000000 |
| #define | EVENT_TIME(e) ((e)->get_key()) |
| #define | EVENT_SEC(e) (EVENT_TIME(e).tv_sec) |
| #define | EVENT_NSEC(e) (EVENT_TIME(e).tv_nsec) |
Typedefs | |
| typedef struct timespec | Time |
Functions | |
| long | msec_to_nsec (const long &msec) |
| long | usec_to_nsec (const long &usec) |
| char * | time_to_char (const Time &t, char *str, size_t str_size=64) |
| Time | timeval_to_time (const struct timeval ¤t_time) |
| Time | read_current_time () |
| Time | time_plus_msec (const Time ¤t_time, const int &msec) |
| bool | operator== (const Time &l, const Time &r) |
| bool | operator< (const Time &l, const Time &r) |
| bool | operator<= (const Time &l, const Time &r) |
| bool | operator> (const Time &l, const Time &r) |
| bool | operator>= (const Time &l, const Time &r) |
Low-level time utilities using POSIX timespec.
Provides Time type and macros for time arithmetic using struct timespec. Includes conversion macros for milliseconds, microseconds, and nanoseconds.
Definition in file ah-time.H.
| #define EVENT_NSEC | ( | e | ) | (EVENT_TIME(e).tv_nsec) |
| #define EVENT_SEC | ( | e | ) | (EVENT_TIME(e).tv_sec) |
|
inline |
|
inline |
Definition at line 103 of file ah-time.H.
References timeval_to_time().
Referenced by TimeoutQueue::schedule_after_ms(), TEST(), TEST(), time_from_now_ms(), and time_from_now_ms().
Definition at line 112 of file ah-time.H.
References MSEC, msec_to_nsec(), NSEC, and sec().
Referenced by TimeoutQueue::schedule_after_ms(), time_from_now_ms(), and time_from_now_ms().
|
inline |
|
inline |
Definition at line 89 of file ah-time.H.
References NSEC, USEC, and usec_to_nsec().
Referenced by read_current_time().
|
inline |
Definition at line 73 of file ah-time.H.
Referenced by timeval_to_time().