develooper Front page | perl.libwww | Postings from July 2001

Web Client Library BOF

Thread Next
From:
Gisle Aas
Date:
July 17, 2001 17:26
Subject:
Web Client Library BOF
Message ID:
lrpuaz9j6w.fsf@caliper.ActiveState.com
#!/usr/bin/perl -w

use strict;
use HTTP::Lite;
use Time::HiRes qw(time);

my $uri = shift || "http://www.activestate.com/";
my $times = 50;

my $sess = HTTP::Lite->new;
my $status;

#warmup
$^W = 0; # HTTP::Lite not clean
$status = $sess->request("http://www.activestate.com/") || die;
$status = $sess->request("http://www.activestate.com/") || die;

open(my $file, ">", "xxx-lite");

my @before = (time, times);

for (1..$times) {
    $sess->{body} = "";  # break in

    $status = $sess->request("http://www.activestate.com/") || die;
    print $file $sess->body;
}

my @after = (time, times);

for my $i (0 .. @after-1) {
    $after[$i] -= $before[$i];
}

print "@after\n";

open(PROC, "/proc/self/status") || die;
while (<PROC>) {
    print if /^VmSize/;
}

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About