use strict;
use Time::HR;
  
sub isPrime {
  my $i = shift;
  my $test;
  for ($test = 2; $test < $i; $test++) {
    if ($i % $test == 0) {
      return 0;
     }
    }       
  return 1;
}
my $n_loops = 10000;
my $t_start = gethrtime();
my $n_primes = 0;
my $i;
for ($i = 0; $i < $n_loops; $i++) {
  if (isPrime($i)) {
    $n_primes++;
  }
}
my $t_end = gethrtime();
my $prime_time = int(($t_end - $t_start)/1000000);
print $prime_time." ";
