You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/10/06 08:13:16 UTC

cvs commit: xml-xerces/perl/samples DOMCount.pl

jasons      01/10/05 23:13:16

  Modified:    perl/samples DOMCount.pl
  Log:
  	* samples/DOMCount.pl (Repository):
  	Added benchmark output
  
  Revision  Changes    Path
  1.10      +7 -3      xml-xerces/perl/samples/DOMCount.pl
  
  Index: DOMCount.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/samples/DOMCount.pl,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DOMCount.pl	2001/07/09 23:13:33	1.9
  +++ DOMCount.pl	2001/10/06 06:13:16	1.10
  @@ -66,6 +66,7 @@
   use strict;
   use XML::Xerces;
   use Getopt::Long;
  +use Benchmark;
   use vars qw(%OPTIONS);
   
   #
  @@ -82,7 +83,7 @@
     * = Default if not provided explicitly
   
   EOU
  -my $VERSION = q[$Id: DOMCount.pl,v 1.9 2001/07/09 23:13:33 jasons Exp $];
  +my $VERSION = q[$Id: DOMCount.pl,v 1.10 2001/10/06 06:13:16 jasons Exp $];
   
   my $rc = GetOptions(\%OPTIONS,
   		    'v=s',
  @@ -122,11 +123,14 @@
   my $error_handler = XML::Xerces::PerlErrorHandler->new();
   $parser->setErrorHandler($error_handler);
   
  +my $t0 = new Benchmark;
   $parser->parse (XML::Xerces::LocalFileInputSource->new($file));
   my $doc = $parser->getDocument ();
   my $element_count = $doc->getElementsByTagName("*")->getLength();
  +my $t1 = new Benchmark;
  +my $td = timediff($t1, $t0);
   
  -print "$file: ($element_count elems)\n";
  -
  +print STDOUT "$file: ($element_count elems)\n";
  +print STDOUT "$file: duration: ", timestr($td), "\n";
   
   __END__
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org