in reply to elapsed connection response time
Is this accurate enough for your purposes?
#! perl -slw use strict; use Time::HiRes qw[ time ]; use IO::Socket::INET; my $s = IO::Socket::INET->new( 'www.bbc.co.uk:80' ) or die "$!, $^E"; my $start = time; print {$s} 'GET //realmedia/fmg2.ram HTTP/1.0', "\n"; my $read; read( $s, $read, 15 ); printf "First 15 bytes ('$read') took %.3f seconds\n", time() - $start +; __END__ C:\test>junk5 First 15 bytes ('HTTP/1.1 200 OK') took 0.402 seconds C:\test>junk5 First 15 bytes ('HTTP/1.1 200 OK') took 0.572 seconds
|
|---|