Re: gettimeofday problem

Christian Robert
2002-06-25T02:03:14Z

Brad Hards wrote:
>
> On Tue, 25 Jun 2002 10:37, Christian Robert wrote:
> > gettimeofday (&tv, NULL);
> How about checking the return value of the function call?
>
> Brad
> --
> http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.

$ time ./tloop
Bump negative -4294967295
Summary:
-------
Min = 0
Max = 140068
Avg = 1 (4064861295/3825797418)

real 67m44.891s
user 29m29.690s
sys 27m53.130s

Same thing. \x14Took about an hour before getting the negative bump.

Xtian.

---- modified GetTime() checking return value of gettimeofday() -----

LL GetTime (void)
{
struct timeval tv;
LL retval;
int rc;

while (0 != (rc = gettimeofday (&tv, NULL)))
printf ("Wow! gettimeofday () returned %d\n", rc);

retval = (tv.tv_sec * 1000000) + (tv.tv_usec);
return retval;
}