#!/usr/bin/perl
# 
# Run the "statstar" program from an input file and measure
#   the run time.
#
# MWR 10/3/2020

$debug = 1;
$niter = 1000;

$cmd = "./statstar < statstar.in > statstar.out 2>&1 ";

for ($i = 0; $i < $niter; $i++) {
  $ret = exec_cmd($cmd);
}

exit 0;




##############################################################################
# PROCEDURE: exec_cmd
#
# DESCRIPTION: Execute the given shell command line.  If the $debug flag
#              is set, we print to stdout the command line, and
#              also print out the result string.
#
# RETURNS:
#              the result of the command
#
#
sub exec_cmd {

  my($cmd, $ret);

  $cmd = $_[0];

  if ($debug > 0) {
    printf "cmd is ..$cmd.. \n";
  }
  $ret = `$cmd`;
  if ($debug > 0) {
    printf "ret is ..$ret.. \n";
  }

  return($ret);
}


