Announcing Template::Timer

petdance on 2004-10-26T15:18:27

Template::Timer provides inline timings of the template processing througout your code. It's an overridden version of Template::Context that wraps the process() and include() methods.

Using Template::Timer is simple. my %config = ( # Whatever your config is INCLUDE_PATH => "/my/template/path", COMPILE_EXT => ".ttc", COMPILE_DIR => "/tmp/tt", );

if ( $development_mode ) { $config{ CONTEXT } = Template::Timer->new( %config ); }

my $template = Template->new( \%config );


Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for.

....

Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs will be doubled up, and slightly longer than the PROCESS call.


Very cool

Aristotle on 2004-10-27T14:09:49

This sounds extremely sweet. I'll have to give it a spin.