TIMEMACROS(3X)

NAME
TV_ADD, TV_SUB, TV_LT, TV_LE, TV_GT. TV_GE, TV_EQ, TV_NE, TV_ISZERO, TV_ZERO, TVP_ADD, TVP_SUB, TVP_LT, TVP_LE, TVP_GT, TVP_GE, TVP_EQ, TVP_NE, TVP_ISZERO, TVP_ZERO - macros for manipulating timeval structures

SYNOPSIS

#include "timemacros.h"

void TV_ADD( tv_res, tv1, tv2 )
struct timeval tv_res, tv1, tv2 ;

void TV_SUB( tv_res, tv1, tv2 )
struct timeval tv_res, tv1, tv2 ;

void TV_ZERO( tv )
struct timeval tv ;

int TV_LT( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_LE( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_GT( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_GE( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_EQ( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_NE( tv1, tv2 )
struct timeval tv1, tv2 ;

int TV_ISZERO( tv )
struct timeval tv ;

DESCRIPTION
There are 2 groups of macros: the TV_* macros expect arguments that are struct timeval's while the TVP_* macros expect arguments that are pointers to struct timeval. In the following only the TV_* macros will be described.

TV_ADD() adds tv1 and tv2 and puts the result in tv_res. The result is "normalized" if the number of microseconds in tv_res exceeds 1 million.

TV_SUB() performs the subtraction tv1-tv2 and places the result in tv_res. The result is "normalized" if the number of microseconds in tv_res becomes negative.

TV_ZERO() sets tv to zero seconds and zero microseconds.

TV_LT(), TV_LE(), TV_GT(), TV_GE(), TV_EQ(), and TV_NE() return TRUE if tv1 is less than, less than or equal, greater than, greater than or equal, equal, or not equal to tv2, respectively.

TV_ISZERO() returns TRUE if tv is equal to zero.