Skip to content

Instantly share code, notes, and snippets.

@ainame
Created September 13, 2013 18:26
Show Gist options
  • Save ainame/6554264 to your computer and use it in GitHub Desktop.
Save ainame/6554264 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Plack::Test;
use HTTP::Request;
use Benchmark qw/timethis/;
my $app = sub { [200, [], ['Hello, World!']] };
test_psgi $app, sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => 'http://localhost/');
timethis(100, sub {
for (1..100) {
$cb->($req);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment