Downloaded succeeded
NAME TIME CUMULATIVE PERCENTAGE
Instantiate Useragent 0.000 0.000 0.002%
Download file 2.400 2.400 99.991%
_stop_ 0.000 2.400 0.007%
####
Downloaded succeeded
NAME TIME CUMULATIVE PERCENTAGE
Instantiate Useragent 0.000 0.000 0.000%
Download file 133.377 133.377 99.988%
_stop_ 0.016 133.392 0.012%
####
use strict;
use warnings;
use LWP;
use Benchmark::Stopwatch;
my $url = 'http://hermes/datasquid/static.dbm';
my $stopwatch = Benchmark::Stopwatch->new->start;
my $ua = LWP::UserAgent->new;
$stopwatch->lap('Instantiate Useragent');
my $response = $ua->get( $url );
$stopwatch->lap('Download file');
if($response->is_success) {
print "Downloaded succeeded\n";
} else {
print "Download failed\n";
}
print $stopwatch->stop->summary;