Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^5: Net::Ping output

by Anonymous Monk
on Aug 20, 2013 at 11:27 UTC ( #1050172=note: print w/replies, xml ) Need Help??


in reply to Re^4: Net::Ping output
in thread Net::Ping output

RTT is stored into $duration; if a packet was received, $ret is true. Are you aware that you are using a programming language and can make the computer do things?
my $p = Net::Ping->new(); $p->hires(); my $received = 0; for (1..4) { # 4 is the amount of packets transmitted my ($ret, $duration, $ip) = $p->ping($host, 5.5); $received++ if $ret; printf "Your RTT is %.2f ms\n", $duration * 1000; } printf "Received %i packets\n", $received;
Throw in a sleep 1; there somewhere if you want.

Replies are listed 'Best First'.
Re^6: Net::Ping output
by gaurav (Acolyte) on Aug 20, 2013 at 14:32 UTC

    Ok , then how it will tell that its minimum or maximum RTT

      The same way you would do it in real life: Compare it to a previously stored minimum and maximum.
Re^6: Net::Ping output
by Anonymous Monk on Aug 22, 2013 at 06:43 UTC
    Are you aware that you are using a programming language and can make the computer do things?

    That is by far the most sarcastic sentence I've read in ages! roflmfao!

    (apologies to gaurav)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050172]
help
Chatterbox?
[marto]: good morning all
[Corion]: Hi marto!
[Corion]: I hope you're well!
[Discipulus]: good morning monks!
[marto]: Corion, I've been better, but things are improving in many cases :) Simply not enough time/rest :)
[Corion]: Hi Discipulus!
[marto]: hopefully you guys are also well :)
[Corion]: marto: Yeah - I'm looking for a week off in a week, even if it'll be a trip to Amsterdam ;)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-07-27 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (404 votes). Check out past polls.