annotate _test/any.pl @ 36:1828103371d0

DOM in works
author Sergey
date Fri, 20 Nov 2009 16:48:08 +0300
parents 818c74b038ae
children c2e7f7c96bcd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
1 #!/usr/bin/perl -w
18
818c74b038ae DOM Schema + tests
Sergey
parents: 11
diff changeset
2 use strict;
36
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
3 use lib '..\Lib';
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
4
36
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
5 require IMPL::DOM::Navigator::SimpleBuilder;
11
75980091813b DOM и навигация
Sergey
parents:
diff changeset
6
36
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
7 my $builder = IMPL::DOM::Navigator::SimpleBuilder->new();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
8
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
9 use Time::HiRes qw(gettimeofday tv_interval);
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
10
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
11 my $t = [gettimeofday];
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
12
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
13 $builder->NavigateCreate('personInfo', version => '1');
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
14 $builder->NavigateCreate('firstName')->nodeValue('Nemo');
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
15 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
16 $builder->NavigateCreate('lastName')->nodeValue('Nobel');
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
17 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
18 $builder->NavigateCreate('lastName')->nodeValue('Gardum');
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
19 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
20 for(1..10000) {
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
21 $builder->NavigateCreate('address', local => 1);
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
22 $builder->NavigateCreate('street')->nodeValue('Hellroad');
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
23 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
24 $builder->NavigateCreate('line')->nodeValue($_);
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
25 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
26 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
27 }
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
28 $builder->Back();
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
29
1828103371d0 DOM in works
Sergey
parents: 18
diff changeset
30 print "Build: ",tv_interval($t,[gettimeofday]),"\n";