*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> timeradd (3)              
Title
Content
Arch
Section
 

TIMERADD(3)

Contents


NAME    [Toc]    [Back]

     timeradd, timersub, timerclear, timerisset, timercmp -- operations on
     timevals

SYNOPSIS    [Toc]    [Back]

     #include <sys/time.h>

     void
     timeradd(struct timeval *a, struct timeval *b, struct timeval *res);

     void
     timersub(struct timeval *a, struct timeval *b, struct timeval *res);

     void
     timerclear(struct timeval *tvp);

     int
     timerisset(struct timeval *tvp);

     int
     timercmp(struct timeval *a, struct timeval *b, CMP);

DESCRIPTION    [Toc]    [Back]

     These macros are provided for manipulating timeval structures for use
     with the gettimeofday(2) and settimeofday(2) calls.  The structure is
     defined in <sys/time.h> as:

     struct timeval {
	     long    tv_sec;	     /* seconds since Jan. 1, 1970 */
	     long    tv_usec;	     /* and microseconds */
     };

     timeradd() adds the time information stored in a to b and stores the
     resulting timeval in res.	The results are simplified such that the value
     of res->tv_usec is always less than 1,000,000 (1 second).

     timersub() subtracts the time information stored in b from a and stores
     the resulting timeval in res.

     timerclear() initializes tvp to midnight (0 hour) January 1st, 1970 (the
     Epoch).

     timerisset() returns true if tvp is set to any time value other than the
     Epoch.

     timercmp() compares a to b using the comparison operator given in CMP,
     and returns the result of that comparison.

SEE ALSO    [Toc]    [Back]

      
      
     gettimeofday(2)

HISTORY    [Toc]    [Back]

     The timeradd() family of macros were imported from NetBSD 1.1, and
     appeared in FreeBSD 2.2.6.


FreeBSD 5.2.1			August 11, 1999 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
BIO_ctrl_wpending Tru64 BIO control operations
BIO_flush Tru64 BIO control operations
BIO_get_close Tru64 BIO control operations
BIO_get_info_callback Tru64 BIO control operations
BIO_ctrl NetBSD BIO control operations
BIO_ctrl Tru64 BIO control operations
BIO_callback_ctrl Tru64 BIO control operations
semop OpenBSD semaphore operations
BN_clear_bit OpenBSD bit operations on BIGNUMs
telldir NetBSD directory operations
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service