script.pl 446 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. use List::Util qw(sum);
  3. for ($n = 1; $n < 13; $n++) {
  4. @values = ();
  5. for ($i = 0; $i < 20; $i++) {
  6. push @values, `../build/src/tests/multithreading/pdevs-multithreading-main $n`;
  7. }
  8. $sum = sum(@values);
  9. $average = $sum / 20;
  10. $sum2 = 0;
  11. for ($i = 0; $i < 20; $i++) {
  12. $e = $values[$i] - $average;
  13. $sum2 = $sum2 + $e * $e;
  14. }
  15. print $n . "\t" . $average . "\t" . (sqrt($sum2) / 20) . "\n";
  16. }