# ********** VisitorDemo.pl **********
use strict;
use ConcreteVisitor1;
use ConcreteVisitor2;
use ConcreteElementA;
use ConcreteElementB;
use Time::HR;

my $t1 = gethrtime();
my $i;
for ($i=0; $i<100000; $i++) {
  my $v1 = ConcreteVisitor1->new();
  my $v2 = ConcreteVisitor2->new();
  my $ea = ConcreteElementA->new();
  my $eb = ConcreteElementB->new();
  $ea->accept($v1);
  $ea->accept($v2);
  $eb->accept($v1);
  $eb->accept($v2);
}
my $t2 = gethrtime();
print (int(($t2-$t1)/1000000))." ";
