my $sel = IO::Select->new($rfh); my $buf = ''; while ($sel->can_read()) { sysread($rfh, $buf, 64*1024, length($buf)) or last; while ($buf =~ s/^(.*)\n//) { my $got = $1; print("It took ", (time()-$got), " seconds to get the msg\n"); } }