1
sarahmx
Execution Time in theme ?
  • 2010/6/12 0:00

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


i tried search but didn't find anything

How do i show page execution/loading time in theme.html


Thank You..

2
Catzwolf
Re: Execution Time in theme ?
  • 2010/6/12 0:29

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


This might help as it is all the info you will need, but how you implement it, is up to you. It should be a starting point.

Code:
$XoopsTime = $GLOBAL['xoopsLogger']->dumpTime( 'XOOPS' );
$XoopsQueries = count( $GLOBAL['xoopsLogger']->queries);

'<p align="center">Page generated <span style="color:#ff0000;">$XoopsTime</span> queries - Generation time: <span style="color:#ff0000;">' . sprintf( "%.4f", $XoopsTime ) . '</span> seconds</p>' . "\n";

I added this into Zarilia/Xoosla and it requires code changes to the core files, if you email me I will update it for Xoops and send you the code.

3
ghia
Re: Execution Time in theme ?
  • 2010/6/12 0:46

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


See FAQ.

4
Catzwolf
Re: Execution Time in theme ?
  • 2010/6/12 0:53

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Which is 6 years old.......... interesting to see how far we have come in those years and fyi, the link is out of date.


5
sarahmx
Re: Execution Time in theme ?
  • 2010/6/12 6:50

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


Thanks Ghia & Catzwolf


Catzwolf
Yes..please update the code to xoops Mr John ..put it in core..
where do i put the code ?

Ghia:
<{php}>
echo 
round(($GLOBALS['xoopsLogger']->dumpTime()), 3)." Seconds | ".count($GLOBALS['xoopsLogger']->queries)." Queries";
<{/
php}>


this is not working i got 0 second 7 queries for all pages..


I'm using XOOPS 2.4.4

6
underdog
Re: Execution Time in theme ?
  • 2010/6/12 7:19

  • underdog

  • Just popping in

  • Posts: 44

  • Since: 2007/6/21


Try this:
<{php}> 
$XoopsTime $GLOBAL['xoopsLogger']->dumpTime'XOOPS' );
$XoopsQueries count$GLOBAL['xoopsLogger']->queries);

echo 
'<p align="center">Page generated <span style="color:#ff0000;">' $XoopsQueries '</span> queries - Generation time: <span style="color:#ff0000;">' sprintf"%.4f"$XoopsTime ) . '</span> seconds</p>' "\n";
<{/
php}>

7
sarahmx
Re: Execution Time in theme ?
  • 2010/6/12 8:29

  • sarahmx

  • Quite a regular

  • Posts: 381

  • Since: 2007/10/28


thank you underdog

i put your code in footer in my theme.html


i got this error in my theme

Fatal errorCall to a member function dumpTime() on a non-object in /xxxxx/xxxx/mydata/caches/smarty_compile/http%253A%252F%252Fxxxxxx%25%25axxxxxx-default^%%B5^B57^B5762074%%theme.html.php  on line 322



clear cache...same problem

8
underdog
Re: Execution Time in theme ?
  • 2010/6/12 9:11

  • underdog

  • Just popping in

  • Posts: 44

  • Since: 2007/6/21


My mistake, really sorry.
It's not $GLOBAL but $GLOBALS
Try this:
<{php}> 
$XoopsTime $GLOBALS['xoopsLogger']->dumpTime'XOOPS' );
$XoopsQueries count$GLOBALS['xoopsLogger']->queries);

echo 
'<p align="center">Page generated <span style="color:#ff0000;">' $XoopsQueries '</span> queries - Generation time: <span style="color:#ff0000;">' sprintf"%.4f"$XoopsTime ) . '</span> seconds</p>' "\n";
<{/
php}>


9
Anonymous
Re: Execution Time in theme ?
  • 2010/6/12 9:42

  • Anonymous

  • Posts: 0

  • Since:


Hi underdog .. remove extra <{php}> in your code and this code work only in case xoopslogger is activated.


10
underdog
Re: Execution Time in theme ?
  • 2010/6/12 9:50

  • underdog

  • Just popping in

  • Posts: 44

  • Since: 2007/6/21


Thanx Mowaffaq
I edited my post and removed the extra <{php}> like you said.
Let's see if it works for sarahmx

Login

Who's Online

172 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits