1
rickh
page generated in 0.xxx seconds
  • 2004/4/21 19:40

  • rickh

  • Just popping in

  • Posts: 94

  • Since: 2004/4/9 6


Is there anyting available (module, XOOPS code) which has the parse time from the page as output?

I want to make a small text at the footer of my site to show this information (page generated in xxx seconds).

2
OldSwede
Re: page generated in 0.xxx seconds
  • 2004/4/21 20:23

  • OldSwede

  • Just popping in

  • Posts: 26

  • Since: 2003/8/15


hello rickh,

put in xoops-root/footer.php after:

$xoopsLogger->stopTime();

this
$ftime=$xoopsLogger->dumpTime();

and in your xoops-root/themes/your-theme/theme.php
at the end or where you want to display it
this:
<{php}>
global 
$ftime;
echo
"Erstellungszeit der Seite = | $ftime | sekunden.";
<{/
php}>



hope i remember it right

3
OldSwede
Re: page generated in 0.xxx seconds
  • 2004/4/21 20:32

  • OldSwede

  • Just popping in

  • Posts: 26

  • Since: 2003/8/15


btw
anyone who nows to shorten down it from:

1.2176561355591

to:

1.217

thanks for help

4
brash
Re: page generated in 0.xxx seconds
  • 2004/4/21 22:06

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


I use this hack and would realy like to be able to limit the output to 2 or 3 decimal places too. It just looks a little messy being as as long as it is.

5
brash
Re: page generated in 0.xxx seconds
  • 2004/4/21 22:07

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Also a catch with using this hack is that you cannot use module caching, otherwise the time output is not shown.

6
Dave_L
Re: page generated in 0.xxx seconds
  • 2004/4/21 22:11

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


echo sprintf('Erstellungszeit der Seite = | %.3f | sekunden.', $ftime);

7
brash
Re: page generated in 0.xxx seconds
  • 2004/4/21 22:20

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Thanks Dave, I'll be giving that a go tonight

8
Venezia
Re: page generated in 0.xxx seconds
  • 2004/4/21 22:39

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


How about adding this line to the very end of footer.php, inside the last closing brace:

if ($xoopsUserIsAdmin) echo sprintf('<div align="center">Request processed in %s seconds</div>', number_format($xoopsLogger->dumpTime(),2));

9
brash
Re: page generated in 0.xxx seconds
  • 2004/4/22 7:14

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


I've tried both Dave's and Venezia's methods of limiting the decimal places of the DumpTime function, and both work well. I've decided to go with Dave's for the moment as it is intergrated into the footer area. However, I think Venezia is the better way to go as it removes the need for editing your theme.html file to enter the code, meaning it is a theme independent hack. I'll see if I can get the placement and formatting of Venezia's hack to work better and post my results.

10
Dave_L
Re: page generated in 0.xxx seconds
  • 2004/4/22 8:36

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Just to make it more confusing ...

You could also assign the numerical value to a Smarty template variable, and then do the actual display within the template.

footer.php

$xoopsLogger->stopTime();
$xoopsTpl->assign('ftime'$xoopsLogger->dumpTime());


in template

Erstellungszeit der Seite = <{$ftime|string_format:"%.3f"}> sekunden.


-------------------

You could also use language strings for the text.

<{$smarty.const._XXXX}> = <{$ftime|string_format:"%.3f"}> <{$smarty.const._YYYY}>.


-------------------

You might be able to make it work even with caching by using the Smarty insert tag.

Login

Who's Online

187 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

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

Latest GitHub Commits