csnip  0.1
Macros | Functions
time.h File Reference

Time utilities. More...

#include <time.h>
#include <csnip/err.h>
Include dependency graph for time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define csnip_time_AsTimespec(src)    csnip_time__AsTimespec((src))
 Convert the given time quantity to a struct timespec. More...
 
#define csnip_time_Convert(src, target)    csnip_time__Convert((src), (target), csnip__tmp_ts)
 Convert a time. More...
 
#define csnip_time_Sleep(amount, err)    csnip_time__Sleep((amount), (err), csnip__cerr)
 Sleep with subsecond precision. More...
 
#define csnip_time_IsLess(time_a, time_b)
 Check if time_a < time_b. More...
 
#define csnip_time_IsLessEqual(time_a, time_b)    csnip_time__IsLessEqual((time_a), (time_b))
 Check if time_a <= time_b. More...
 
#define csnip_time_Add(time_a, time_b)
 Compute the sum of two times. More...
 
#define csnip_time_Sub(time_a, time_b)
 Compute the difference of two times. More...
 

Functions

int csnip_time_sleep (struct timespec ts)
 Sleep with subsecond precision.
 
int csnip_time_is_less (struct timespec a, struct timespec b)
 Less-than comparison.
 
int csnip_time_is_less_equal (struct timespec a, struct timespec b)
 Less-than-or-equal comparison.
 
struct timespec csnip_time_add (struct timespec a, struct timespec b)
 Compute the sum of two durations.
 
struct timespec csnip_time_sub (struct timespec a, struct timespec b)
 Compute the difference of two durations.
 
Conversion to struct timespec.
struct timespec csnip_time_time_t_as_timespec (time_t t)
 time_t -> timespec
 
struct timespec csnip_time_float_as_timespec (float f)
 float -> timespec
 
struct timespec csnip_time_double_as_timespec (double d)
 double -> timespec
 
struct timespec csnip_time_ldouble_as_timespec (long double d)
 long double -> timespec
 
struct timespec csnip_time_timeval_as_timespec (struct timeval tv)
 timeval -> timespec
 
Conversion from struct timespec.
time_t csnip_time_timespec_as_time_t (struct timespec ts)
 timespec -> time_t
 
float csnip_time_timespec_as_float (struct timespec ts)
 timespec -> float
 
double csnip_time_timespec_as_double (struct timespec ts)
 timespec -> double
 
long double csnip_time_timespec_as_ldouble (struct timespec ts)
 timespec -> long double
 
struct timeval csnip_time_timespec_as_timeval (struct timespec ts)
 timespec -> timeval