Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

measure transfer time

Status
Not open for further replies.

Behruz

Programmer
Joined
May 12, 2007
Messages
5
Location
AU
will this code allow me to measure the time it takes to transfer an image from one PC to another?

#! perl -w
use strict;

use Net::FTP;
use Time::HiRes qw(gettimeofday tv_interval);

my $ftp = Net::FTP->new("train1", Debug =>0) or die "Cannot connect to some.host.name: $@;

$ftp->login("IT",'itadmin') or die "Cannot login ", $ftp->message;
my $return = $ftp->site('binary');
print "return = $return\n";

for (my $1 = 0; $i < 10; $i++) {
my $t0 = [gettimeofday];

$ftp->get("testfile") or die "get failed", $ftp->message;
my $t1 = [gettimeofday];

my $elapsed = tv_interval ($t0, $t1);

print $elapsed. "\n";
}
$ftp->quite;
 
more or less I would assume.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I might be stating the obvious here, but what happened after you tried it, did it work?
 
yes it more or less did.

Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top