Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: elapsed connection response time

by BrowserUk (Pope)
on Jul 25, 2007 at 15:47 UTC ( #628708=note: print w/replies, xml ) Need Help??


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

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://628708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2021-06-24 22:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (133 votes). Check out past polls.

    Notices?