Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # server.pl
- use Time::HiRes;
- app->hook(before_dispatch => sub {
- app->defaults(request_start_time => [gettimeofday]);
- });
- # index.html.ep
- % my $request_timer = begin
- <p>Page served in <%= Time::HiRes::tv_interval($request_start_time) %> seconds.</p>
- % end
- <%= $request_timer->() %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement