# ********** TemplateDemo.pl **********
use strict;
use ConcreteClass1;
use ConcreteClass2;
use Time::HR;

my $t1 = gethrtime();
my $i;
my $j;
for ($i=0; $i<2000; $i++) {
  my $concrete1 = ConcreteClass1->new();
  my $concrete2 = ConcreteClass2->new();
  for ($j=0; $j<2000; $j++) {
    $concrete1->templateMethod();
    $concrete2->templateMethod();
  }
}
my $t2 = gethrtime();
print (int(($t2-$t1)/1000000))." ";
