use LWP::Debug qw(+); use Time::HiRes qw(gettimeofday tv_interval); my $ts; use LWP::Protocol::http; use Hook::LexWrap; wrap 'LWP::Protocol::http::SocketMethods::sysread', pre => sub { $ts = [gettimeofday] }, post => sub { printf ">>%.5f\n" , tv_interval($ts) };