Main Page | Data Structures | File List | Globals

libgu/gu_timeval.c File Reference

real-world clock routines More...

#include "before_system.h"
#include <sys/time.h>
#include "gu.h"

Functions

int gu_timeval_cmp (const struct timeval *t1, const struct timeval *t2)
 Compare two times in struct timeval format.

void gu_timeval_sub (struct timeval *t1, const struct timeval *t2)
 Subtract one time in struct timeval format from another.

void gu_timeval_add (struct timeval *t1, const struct timeval *t2)
 Add one time in struct timeval format to another.

void gu_timeval_cpy (struct timeval *t1, const struct timeval *t2)
 Copy a struct timeval.

void gu_timeval_zero (struct timeval *t)


Detailed Description

real-world clock routines

These are utility routines for dealing with real-world clock values (struct timeval). They provide a way to zero, copy, add, subtract, and compare such values.


Function Documentation

void gu_timeval_add struct timeval *  t1,
const struct timeval *  t2
 

Add one time in struct timeval format to another.

This utility function adds t2 to t1.

int gu_timeval_cmp const struct timeval *  t1,
const struct timeval *  t2
 

Compare two times in struct timeval format.

This utility function is used to compare times. It returns 1 if t1 is greater than t2, zero if t1 is equal to t2, and -1 if t1 is less than t2.

void gu_timeval_cpy struct timeval *  t1,
const struct timeval *  t2
 

Copy a struct timeval.

This utility function copies time t2 to time t1.

void gu_timeval_sub struct timeval *  t1,
const struct timeval *  t2
 

Subtract one time in struct timeval format from another.

This utility function is used to subtract time t2 from time t1.


Generated on Fri Feb 20 15:17:52 2004 for PPR Libraries by doxygen 1.3.5