home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
libfake
/
gettimeofday.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-27
|
520b
|
25 lines
/*
* fake gettimeofday
*
* You might think that times() could be used to get sub-second timer
* resolution, but apart from miscellaneous practical problems, there
* is no guarantee that its second boundaries are the same as time()'s.
*/
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
/* ARGSUSED */
int
gettimeofday(tvp, tzp)
struct timeval *tvp;
struct timezone *tzp;
{
(void) time(&tvp->tv_sec);
tvp->tv_usec = 0; /* no good alternative */
/* assert(tzp == NULL); */
}