# ********** StrategyDemo.pl **********
use strict;
use Context;
use ConcreteStrategy1;
use ConcreteStrategy2;
use Time::HR;

my $t1 = gethrtime();
my $i;
my $j;
for ($i=0; $i<10*1000; $i++) {
  my $context1 = Context->new(ConcreteStrategy1->new());
  my $context2 = Context->new(ConcreteStrategy2->new());
  for ($j=0; $j<1000; $j++) {
    $context1->compute();
    $context2->compute();
  }
}
my $t2 = gethrtime();
print (int(($t2-$t1)/1000000))." ";
