package Template::Plugin::Timer; use strict; use warnings; use Benchmark::Timer; use base qw(Template::Plugin); our $VERSION = '0.02'; sub new { my $class = shift; my $context = shift; my %args = ref($_[0]) eq 'HASH' ? %{$_[0]} : (); Benchmark::Timer->new(%args); } 1; __END__ =head1 NAME Template::Plugin::Timer - A Template Plugin to Profile Template Processing =head1 SYNOPSIS [% USE timer = Timer( ... options for Benchmark::Timer ... ) %] [% CALL timer.start('part1') %] ... do something you want to measure the time ... [% CALL timer.stop('part1') %] [% CALL timer.start('part2') %] ... do something you want to measure the time ... [% CALL timer.stop('part2') %] [% FOREACH report IN timer.reports %] [% report %] [% END %] =head1 DESCRIPTION Template::Plugin::Timer is just a glue module between L