[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: Scott Lamb <slamb_at_slamb.org>
Date: 2002-08-02 07:30:13 CEST

On Fri, Aug 02, 2002 at 12:58:59AM +0100, Philip Martin wrote:
> Philip Martin <philip@codematters.co.uk> writes:
>
> > $ 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)

Shouldn't this be

if (tv.tv_sec < tv2.tv_sec ||
    (tv.tv_sec == tv2.tv_sec && tv.tv_usec < tv2.tv_usec)) ?

(Not that it matters. That would only show more occurrences.)

> > printf ("%ld: %ld < %ld\n", i, tv.tv_usec, tv2.tv_usec);
> > }
> > tv2 = tv;
> > }
> > return EXIT_SUCCESS;
> > }
> > $ gcc z.c
> > $ ./a.out
>
> Whoops, hit send by mistake! Here's what I get on my dual PIII system
>
> $ ./a.out
> 43043: 374436 < 374437
> 524931: 904361 < 904362
> 778682: 184323 < 184324
> 887643: 304306 < 304307
> 1014906: 444288 < 444289
> 1187703: 634262 < 634263
> 1296827: 754245 < 754246
> 1315004: 774241 < 774242
> 1442331: 914224 < 914225
> 1596600: 84201 < 84202
>
> so yes it goes backwards.

Just to satisfy my/your/whoever's curiosity: are you using Linux? What
version? I saw this on kernel traffic a while back:
<http://kt.zork.net/kernel-traffic/kt20020708_174.html#1>

-- 
Scott Lamb
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 2 07:30:13 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.