Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How to get rendering time in live mode?
I’m looking for way to get rendering time which can be seen while debug-test modes. But i want this while site in live mode. Is it possible?
I want to prepare some statistic about site loading…
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: How to get rendering time in live mode?
Yes, no, yes, no and yes. Basically yes.
- Query times are in global
$qtime
. - Total query count is stored in
$qcount
. - Page rendering start time is stored in
$microstart
.
Using those we can do magic:
<txp:php>
global $qtime, $qcount, $microstart;
echo
'<!-- Runtime: '.(getmicrotime() - $microstart).'-->'.n.
'<!-- Query time: '.$qtime.'-->'.n.
'<!-- Queries: '.$qcount.'-->'.
maxMemUsage('end of textpattern()',1)
;
</txp:php>
Last edited by Gocom (2010-04-02 02:42:34)
Offline
Re: How to get rendering time in live mode?
It works! Thanks!
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline