Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

time_util.h File Reference


Detailed Description

Inline functions for manipulating time values.

Include dependency graph for time_util.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define MICROS_PER_SECOND   1000000
 The number of microseconds per second.

#define NANOS_PER_MICRO   1000
 The number of nanoseconds per microsecond.

#define tscmp(tvp, uvp, cmp)
 Compare two timespec's.


Functions

timespec microsec_to_timespec (unsigned long long microseconds)
 Convert a microsecond value to a struct timespec.

unsigned long long timespec_to_microsec (struct timespec *time_spec)
 Convert a timespec to a microsecond value.


Define Documentation

#define tscmp tvp,
uvp,
cmp   ) 
 

Value:

(((tvp)->tv_sec == (uvp)->tv_sec) ?                             \
            ((tvp)->tv_nsec cmp (uvp)->tv_nsec) :                       \
            ((tvp)->tv_sec cmp (uvp)->tv_sec))
Compare two timespec's.

Parameters:
tvp Pointer to the first timespec.
uvp Pointer to the second timespec.
cmp The comparison operator.


Function Documentation

struct timespec microsec_to_timespec unsigned long long  microseconds  )  [inline, static]
 

Convert a microsecond value to a struct timespec.

Parameters:
microseconds The microsecond value to convert.
Returns:
A timespec that represents the given number of microseconds.

unsigned long long timespec_to_microsec struct timespec *  time_spec  )  [inline, static]
 

Convert a timespec to a microsecond value.

NOTE: There is a loss of precision in the conversion.

Parameters:
time_spec The timespec to convert.
Returns:
The number of microseconds specified by the timespec.


Generated on Mon Dec 1 16:22:36 2003 for CPUBroker by doxygen 1.3.4