Thread Net::Ping - tcp oder icmp?: Was ist besser? (8 answers)
Opened by format_c at 2007-01-16 16:38

format_c
 2007-01-16 22:30
#73249 #73249
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Hier das Ergebnis:
Code: (dl )
1
2
3
4
5
6
format_c@boston ~ $ su -c "perl test.pl 192.168.0.6"
Password:
Benchmark: timing 1000000 iterations of ICMP: , TCP: ...
ICMP: : 229 wallclock secs (58.44 usr + 16.73 sys = 75.17 CPU) @ 13303.18/s (n=1000000)
TCP: : 326 wallclock secs (137.08 usr + 36.07 sys = 173.15 CPU) @ 5775.34/s (n=1000000)
format_c@boston ~ $


Und hier das Skript:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use Net::Ping;
use Benchmark;

my $tcp = Net::Ping->new("tcp");
my $icmp = Net::Ping->new("icmp");

timethese(1_000_000,
        {
               
 "TCP:  " => sub { $tcp->ping($ARGV[0]); } ,
               
 "ICMP: " => sub { $icmp->ping($ARGV[0]); }
        }
);




Gruß Alex\n\n

<!--EDIT|format_c|1168979486-->

View full thread Net::Ping - tcp oder icmp?: Was ist besser?