New in Symfony 2.4: A Stopwatch Tag for Twig

Warning: This post is about an unsupported Symfony version. Some of this information may be out of date. Read the most recent Symfony Docs.
Contributed by
Wouter De Jong
and
Fabien Potencier
in #8719.
Ever wanted to time parts of a template? The new Symfony 2.4 stopwatch
tag
allows you to time any part of a template. This information is then stored in
the profiler and available in the "timeline" section of the web profiler:
1 2 3
{% stopwatch "foo" %}
... some things that gets timed
{% endstopwatch %}
You can also use the same name more than once in your project to group the times on the same line in the web profiler timeline.
The tag being part of the Twig bridge, you can also leverage it in your Silex applications.
Help the Symfony project!
As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.
Comments
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.
Symfony2.4 will come with so nice new features. Can't wait to it...
should be even easier