Command-line history logging utilities

benchmark.pl 383B

12345678910111213141516171819202122232425
  1. #!/usr/bin/perl
  2. use Benchmark;
  3. $script = $ARGV[0];
  4. # declare array
  5. my @data;
  6. # start timer
  7. $start = new Benchmark;
  8. for ($x = 0; $x <= 100; $x++) {
  9. $output = `perl ./$script`;
  10. }
  11. # end timer
  12. $end = new Benchmark;
  13. # calculate difference
  14. $diff = timediff($end, $start);
  15. # report
  16. print "Content-type: text/plain\n\n";
  17. print "Time taken was ", timestr($diff, 'all'), " seconds";