[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[xml] xmllint: bogus output with --repeat and --timing



Hi Daniel,

In libxml2-2.4.11 xmllint produces bogus output when called with
the --repeat and --timing options:

    $ xmllint --noout --repeat --timing myfile.xml
    100 iteration took 0 ms
    100 iteration took 0 ms
    100 iteration took 0 ms
    100 iteration took 1213 ms

The enclosed patch fixes the problem.

Geert

*** xmllint.c.orig	Tue Dec  4 12:57:19 2001
--- xmllint.c	Tue Dec  4 13:14:09 2001
***************
*** 1082,1095 ****
  	    } else
  		parseAndPrintFile(argv[i]);
  	    files ++;
! 	}
! 	if ((timing) && (repeat)) {
! 	    long msec;
! 	    gettimeofday(&end, NULL);
! 	    msec = end.tv_sec - begin.tv_sec;
! 	    msec *= 1000;
! 	    msec += (end.tv_usec - begin.tv_usec) / 1000;
! 	    fprintf(stderr, "100 iteration took %ld ms\n", msec);
  	}
      }
      if (generate) 
--- 1082,1095 ----
  	    } else
  		parseAndPrintFile(argv[i]);
  	    files ++;
! 	    if ((timing) && (repeat)) {
! 		long msec;
! 		gettimeofday(&end, NULL);
! 		msec = end.tv_sec - begin.tv_sec;
! 		msec *= 1000;
! 		msec += (end.tv_usec - begin.tv_usec) / 1000;
! 		fprintf(stderr, "100 iterations took %ld ms\n", msec);
! 	    }
  	}
      }
      if (generate) 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]