diff _test/any.pl @ 36:1828103371d0

DOM in works
author Sergey
date Fri, 20 Nov 2009 16:48:08 +0300
parents 818c74b038ae
children c2e7f7c96bcd
line wrap: on
line diff
--- a/_test/any.pl	Tue Nov 17 17:46:24 2009 +0300
+++ b/_test/any.pl	Fri Nov 20 16:48:08 2009 +0300
@@ -1,10 +1,30 @@
 #!/usr/bin/perl -w
 use strict;
+use lib '..\Lib';
 
-my @data = (1,2,3,4);
+require IMPL::DOM::Navigator::SimpleBuilder;
 
-sub func {
-    return \@data;
-}
-
-print "$_\n" and $data[3]=0 foreach @{func()};
+my $builder = IMPL::DOM::Navigator::SimpleBuilder->new();
+    
+    use Time::HiRes qw(gettimeofday tv_interval);
+    
+    my $t = [gettimeofday];
+    
+    $builder->NavigateCreate('personInfo', version => '1');
+        $builder->NavigateCreate('firstName')->nodeValue('Nemo');
+        $builder->Back();
+        $builder->NavigateCreate('lastName')->nodeValue('Nobel');
+        $builder->Back();
+        $builder->NavigateCreate('lastName')->nodeValue('Gardum');
+        $builder->Back();
+        for(1..10000) {
+            $builder->NavigateCreate('address', local => 1);
+                $builder->NavigateCreate('street')->nodeValue('Hellroad');
+                $builder->Back();
+                $builder->NavigateCreate('line')->nodeValue($_);
+                $builder->Back();
+            $builder->Back();
+        }
+    $builder->Back();
+    
+    print "Build: ",tv_interval($t,[gettimeofday]),"\n";
\ No newline at end of file