April 14, 2003
- updated February 8, 2006
The MTTimer tags allow you to display the time it took for MovableType to build your page, or portions of your page. If your page builds take a long time, the MTTimer tags may help you detect which parts of your page take the longest time to build. They are also useful to fine tune performance when developing plugins.
Starts a new timer or restarts and existing timer. The default timer is automatically started when the CGI that is building the page begins executing.
Specifies the name of the timer. The default value is “”, meaning the default timer.
Displays the time elapsed since the specified timer was started.
Place the following tag at the bottom of your search template (MovableType/search_templates/default.tmpl) to show how long it took to perform the search:
<MTTimerValue format="Search time: %.2f seconds.">
The following code uses two timers (“entries” and “entry”) which will display individual and cumulative times for building a list of entries followed by status information about how much time was spent building the page inside the MTEntries tags:
<MTTimerValue name="entry">, <MTTimerValue name="entries">
<pre><MTTimerValue name="entries" clock="stats"></pre>