Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
t/ | H | 07-Mar-2009 | - | 55 | 35 | |
Changes | H A D | 07-Mar-2009 | 966 | 38 | 24 | |
MANIFEST | H A D | 07-Mar-2009 | 116 | 10 | 9 | |
META.yml | H A D | 07-Mar-2009 | 641 | 20 | 19 | |
Makefile.PL | H A D | 07-Mar-2009 | 1.1 KiB | 49 | 39 | |
README | H A D | 07-Mar-2009 | 1.6 KiB | 55 | 37 | |
Timer.pm | H A D | 07-Mar-2009 | 4 KiB | 155 | 59 |
README
1Template::Timer provides inline timings of the template processing 2througout your code. It's an overridden version of Template::Context 3that wraps the process() and include() methods. 4 5Using Template::Timer is simple. 6 7 my %config = ( # Whatever your config is 8 INCLUDE_PATH => "/my/template/path", 9 COMPILE_EXT => ".ttc", 10 COMPILE_DIR => "/tmp/tt", 11 ); 12 13 if ( $development_mode ) { 14 $config{ CONTEXT } = Template::Timer->new( %config ); 15 } 16 17 my $template = Template->new( \%config ); 18 19Now when you process templates, HTML comments will get embedded in your 20output, which you can easily grep for. 21 22 <!-- TIMER START: process mainmenu/mainmenu.ttml --> 23 <!-- TIMER START: include mainmenu/cssindex.tt --> 24 <!-- TIMER START: process mainmenu/cssindex.tt --> 25 <!-- TIMER END: process mainmenu/cssindex.tt (0.017279 seconds) --> 26 <!-- TIMER END: include mainmenu/cssindex.tt (0.017401 seconds) --> 27 28.... 29 30 <!-- TIMER END: process mainmenu/footer.tt (0.003016 seconds) --> 31 <!-- TIMER END: include mainmenu/footer.tt (0.003104 seconds) --> 32 <!-- TIMER END: process mainmenu/mainmenu.ttml (0.400409 seconds) --> 33 34INSTALLATION 35 36To install this module, run the following commands: 37 38 perl Makefile.PL 39 make 40 make test 41 make install 42 43 44COPYRIGHT AND LICENSE 45 46Copyright (C) 2004-2009 Andy Lester 47 48This library is free software; you can redistribute it and/or modify 49it under the terms of either the GNU Public License v3, or the Artistic 50License 2.0. 51 52 * http://www.gnu.org/copyleft/gpl.html 53 54 * http://www.opensource.org/licenses/artistic-license-2.0.php 55