timeval.h File Reference

Utility functions for handling timeval calculations. More...

Go to the source code of this file.

Defines

#define PA_MSEC_PER_SEC   1000
#define PA_USEC_PER_SEC   1000000
#define PA_NSEC_PER_SEC   1000000000
#define PA_USEC_PER_MSEC   1000

Functions

timeval * pa_gettimeofday (struct timeval *tv)
 Return the current timestamp, just like UNIX gettimeofday().
pa_usec_t pa_timeval_diff (const struct timeval *a, const struct timeval *b) PA_GCC_PURE
 Calculate the difference between the two specified timeval structs.
int pa_timeval_cmp (const struct timeval *a, const struct timeval *b) PA_GCC_PURE
 Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwse.
pa_usec_t pa_timeval_age (const struct timeval *tv)
 Return the time difference between now and the specified timestamp.
timeval * pa_timeval_add (struct timeval *tv, pa_usec_t v) PA_GCC_PURE
 Add the specified time inmicroseconds to the specified timeval structure.
timeval * pa_timeval_store (struct timeval *tv, pa_usec_t v)
 Store the specified uec value in the timeval struct.
pa_usec_t pa_timeval_load (const struct timeval *tv)
 Load the specified tv value and return it in usec.


Detailed Description

Utility functions for handling timeval calculations.


Define Documentation

#define PA_MSEC_PER_SEC   1000
 

#define PA_NSEC_PER_SEC   1000000000
 

#define PA_USEC_PER_MSEC   1000
 

#define PA_USEC_PER_SEC   1000000
 


Function Documentation

struct timeval* pa_gettimeofday struct timeval *  tv  ) 
 

Return the current timestamp, just like UNIX gettimeofday().

Examples:
pacat.c.

struct timeval* pa_timeval_add struct timeval *  tv,
pa_usec_t  v
 

Add the specified time inmicroseconds to the specified timeval structure.

Examples:
pacat.c.

pa_usec_t pa_timeval_age const struct timeval *  tv  ) 
 

Return the time difference between now and the specified timestamp.

int pa_timeval_cmp const struct timeval *  a,
const struct timeval *  b
 

Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwse.

pa_usec_t pa_timeval_diff const struct timeval *  a,
const struct timeval *  b
 

Calculate the difference between the two specified timeval structs.

pa_usec_t pa_timeval_load const struct timeval *  tv  ) 
 

Load the specified tv value and return it in usec.

Since:
0.9.7

struct timeval* pa_timeval_store struct timeval *  tv,
pa_usec_t  v
 

Store the specified uec value in the timeval struct.

Since:
0.9.7


Generated on Sun Jun 28 22:58:14 2009 for PulseAudio by  doxygen 1.4.6