#include <linux/time.h>
Go to the source code of this file.
Defines | |
#define | KAL_TIME_NS(sec, nsec) (struct timespec) { .tv_sec = (sec), .tv_nsec = ((long unsigned) nsec) } |
#define | KAL_TIME_US(sec, usec) (struct timespec) { .tv_sec = (sec), .tv_nsec = ((long unsigned) usec) * 1000 } |
#define | KAL_TIME_FMT "<%6lu.%06lu>" |
#define | KAL_TIME_FMT_ARG(t) kal_time_get_sec(t), kal_time_get_usec(t) |
Typedefs | |
typedef struct timespec | kal_time_t |
Implementation of kal_time_t through a timespec structure. | |
Functions | |
static kal_time_t | kal_time_ns (unsigned long sec, unsigned long nsec) |
static signed long | kal_time_get_sec (kal_time_t t) |
static unsigned long | kal_time_get_nsec (kal_time_t t) |
static unsigned long | kal_time_get_usec (kal_time_t t) |
static unsigned long long | kal_time2usec (kal_time_t t) |
static kal_time_t | kal_usec2time (unsigned long long usec) |
static kal_time_t | kal_time_add (kal_time_t ta, kal_time_t tb) |
static kal_time_t | kal_time_sub (kal_time_t ta, kal_time_t tb) |
static struct timespec | kal_time2timespec (kal_time_t t) |
static int | kal_time_lt (kal_time_t t1, kal_time_t t2) |
Forcing a (unneeded) signed comparison among seconds. | |
static int | kal_time_le (kal_time_t t1, kal_time_t t2) |
unsigned long | get_simulation_time (void) |
static unsigned long | timespec_to_usec (const struct timespec *t) |
static void | usec_to_timespec (const unsigned long usec, struct timespec *t) |
static kal_time_t | kal_time_now (void) |
#define KAL_TIME_FMT "<%6lu.%06lu>" |
Definition at line 28 of file kal_time_timespec.h.
#define KAL_TIME_FMT_ARG | ( | t | ) | kal_time_get_sec(t), kal_time_get_usec(t) |
Definition at line 30 of file kal_time_timespec.h.
#define KAL_TIME_NS | ( | sec, | |||
nsec | ) | (struct timespec) { .tv_sec = (sec), .tv_nsec = ((long unsigned) nsec) } |
Definition at line 25 of file kal_time_timespec.h.
#define KAL_TIME_US | ( | sec, | |||
usec | ) | (struct timespec) { .tv_sec = (sec), .tv_nsec = ((long unsigned) usec) * 1000 } |
Definition at line 26 of file kal_time_timespec.h.
typedef struct timespec kal_time_t |
Implementation of kal_time_t through a timespec structure.
Definition at line 23 of file kal_time_timespec.h.
unsigned long get_simulation_time | ( | void | ) |
static struct timespec kal_time2timespec | ( | kal_time_t | t | ) | [static, read] |
Definition at line 83 of file kal_time_timespec.h.
static unsigned long long kal_time2usec | ( | kal_time_t | t | ) | [inline, static] |
Definition at line 49 of file kal_time_timespec.h.
static kal_time_t kal_time_add | ( | kal_time_t | ta, | |
kal_time_t | tb | |||
) | [inline, static] |
Definition at line 59 of file kal_time_timespec.h.
static unsigned long kal_time_get_nsec | ( | kal_time_t | t | ) | [inline, static] |
Definition at line 41 of file kal_time_timespec.h.
static signed long kal_time_get_sec | ( | kal_time_t | t | ) | [inline, static] |
Definition at line 37 of file kal_time_timespec.h.
static unsigned long kal_time_get_usec | ( | kal_time_t | t | ) | [inline, static] |
Definition at line 45 of file kal_time_timespec.h.
static int kal_time_le | ( | kal_time_t | t1, | |
kal_time_t | t2 | |||
) | [inline, static] |
Definition at line 93 of file kal_time_timespec.h.
static int kal_time_lt | ( | kal_time_t | t1, | |
kal_time_t | t2 | |||
) | [inline, static] |
Forcing a (unneeded) signed comparison among seconds.
Definition at line 88 of file kal_time_timespec.h.
static kal_time_t kal_time_now | ( | void | ) | [inline, static] |
Definition at line 119 of file kal_time_timespec.h.
References get_simulation_time(), and usec_to_timespec().
static kal_time_t kal_time_ns | ( | unsigned long | sec, | |
unsigned long | nsec | |||
) | [inline, static] |
Definition at line 32 of file kal_time_timespec.h.
static kal_time_t kal_time_sub | ( | kal_time_t | ta, | |
kal_time_t | tb | |||
) | [inline, static] |
Definition at line 71 of file kal_time_timespec.h.
static kal_time_t kal_usec2time | ( | unsigned long long | usec | ) | [inline, static] |
Definition at line 53 of file kal_time_timespec.h.
References KAL_TIME_US.
static unsigned long timespec_to_usec | ( | const struct timespec * | t | ) | [inline, static] |
Definition at line 111 of file kal_time_timespec.h.
static void usec_to_timespec | ( | const unsigned long | usec, | |
struct timespec * | t | |||
) | [inline, static] |
Definition at line 115 of file kal_time_timespec.h.
References KAL_TIME_US.
Referenced by kal_time_now().