[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 2845 - trunk/subversion/tests/libsvn_fs

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-08-02 01:55:38 CEST

cmpilato@collab.net writes:

> actually looks like apr_time_now() returns values that are *not*
> necessarily ordered as one would expect. I suppose perhaps I could be
> suffering some clock drift, but I don't see anything in
> /var/log/* to indicate such a thing.
>
> apr_time_now() on Unix just calls gettimeofdate() ... are there any
> known problems that I should be aware of? My APR is a couple of weeks
> out of date, but somehow that doesn't seem too important.

$ cat z.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

int
main(int argc,
     char *argv[])
{
   long i = 0;
   while (++i)
   {
      static struct timeval tv, tv2;
      static int flag = 0;

      if (gettimeofday(&tv,NULL))
      {
         perror ("gettimeofday failed");
         exit (1);
      }
      if (!flag)
        flag = 1;
      else
      {
         if (tv.tv_usec < tv2.tv_usec && tv.tv_sec <= tv2.tv_sec)
            printf ("%ld: %ld < %ld\n", i, tv.tv_usec, tv2.tv_usec);
      }
      tv2 = tv;
   }
   return EXIT_SUCCESS;
}
$ gcc z.c
$ ./a.out

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 2 01:56:18 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.