File: README

package info (click to toggle)
libtemplate-timer-perl 1.00-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 84 kB
  • ctags: 3
  • sloc: perl: 94; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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.

    <!-- TIMER START: process mainmenu/mainmenu.ttml -->
    <!-- TIMER START: include mainmenu/cssindex.tt -->
    <!-- TIMER START: process mainmenu/cssindex.tt -->
    <!-- TIMER END: process mainmenu/cssindex.tt (0.017279 seconds) -->
    <!-- TIMER END: include mainmenu/cssindex.tt (0.017401 seconds) -->

....

    <!-- TIMER END: process mainmenu/footer.tt (0.003016 seconds) -->
    <!-- TIMER END: include mainmenu/footer.tt (0.003104 seconds) -->
    <!-- TIMER END: process mainmenu/mainmenu.ttml (0.400409 seconds) -->

INSTALLATION

To install this module, run the following commands:

    perl Makefile.PL
    make
    make test
    make install


COPYRIGHT AND LICENSE

Copyright (C) 2004-2009 Andy Lester

This library is free software; you can redistribute it and/or modify
it under the terms of either the GNU Public License v3, or the Artistic
License 2.0.

    * http://www.gnu.org/copyleft/gpl.html

    * http://www.opensource.org/licenses/artistic-license-2.0.php