#! /usr/bin/perl $packets = $ARGV[0]; while(<STDIN>) { if(/real\s+(\d+)m([0-9.]+)s/) { $minutes = $1; $secs = $2; $time = ($minutes * 60) + $secs; printf "%d %f\n", $packets, $packets / $time; } }