Updated code to test gettimeofday() ... - Mailing list pgsql-hackers

From Marc G. Fournier
Subject Updated code to test gettimeofday() ...
Date
Msg-id 20031129191430.A99096@ganymede.hub.org
Whole thread Raw
List pgsql-hackers
Just as an FYI, there are continuing talks on FreeBSD's mailng lists about
this issue, in hopes of getting it corrected ... if anyone here is using
FreeBSD, you'll want to check out the -current mailing list, where
discussions are taking place ...

Update code for testing is included here, though, with which
Poul-Henning(sp?) is requesting problem reports issued against ...

#include <stdio.h>
#include <sys/time.h>

int
main()
{       struct timeval prevtime;       struct timeval curtime;       double last, now;
       gettimeofday(&prevtime, NULL);       last = prevtime.tv_sec + prevtime.tv_usec * 1e-6;
       for (;;)       {               gettimeofday(&curtime, NULL);               now = curtime.tv_sec +
curtime.tv_usec* 1e-6;
 
               if (now < last) {                       printf("%f %f %d.%06d %d.%06d\n", now, last,
     curtime.tv_sec, curtime.tv_usec,                           prevtime.tv_sec, prevtime.tv_usec);               }
         last = now;               prevtime = curtime;       }
 
       return 0;
}


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664


pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: $Id$ -> $PostgreSQL$ Change
Next
From: Neil Conway
Date:
Subject: Re: Materialized views proposal