Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (36 sloc) 885 Bytes
package Angelos::Middleware::Profile;
use Mouse;
use Time::HiRes qw(time);
extends 'Angelos::Middleware';
no Mouse;
sub wrap {
my ( $self, $next ) = @_;
sub {
my $req = shift;
my $res = $self->profile( $next, $req );
sub profile {
my ( $self, $code, $args ) = @_;
my $start_time = time();
my $result = $code->($args);
my $end_time = time();
my $elapsed = $end_time - $start_time;
my $message = "Request handling time: \n" . $elapsed . " secs";
=head1 NAME
=head1 AUTHOR
Takatoshi Kitano E<lt><gt>
=head1 SEE ALSO
=head1 LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Jump to Line
Something went wrong with that request. Please try again.