symfony/symfony — pull request #8719 by fabpot (2013-08-11 20:59:05+00:00)
Title: [TwigBundle] Created stopwatch tag for profiling templates

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7953
| License | MIT
| Doc PR | symfony/symfony-docs#2630

This PR is the continuation of #7953

This PR adds a new tag to Twig which you can use to time parts of a template and see it in the timing tab of the profiler.

Usage:

````jinja
{% stopwatch foo %}
... some things that gets timed
{% endstopwatch %}
````

The main differences with the original PR are:

* I have removed the code that checks is stopwatch is available as the check is already done during compilation
* I have removed the check for names that was already used as it is not needed (the stopwatch knows how to deal with such cases).