PDA

View Full Version : Board Optimization - Forum Load Time Indicator


UKBusinessLive
05 Dec 2008, 16:17
Ever wanted to see just how fast your board is loading?? Its a bit slow but your not sure how slow?? Just loaded a new hack - Is your board just as fast???

Well now you'll know with this simple little hack that sits queitly at the bottom of your footer. A timer starts when the page begins to parse and ends when it has completed loading all of the content. The result is the time in seconds of how fast (or slow) your forums are loading.

The Instructions are so simple too :D

ACP> Style Manager > Your Forum Style

1. Copy the code below into your forum's style headerinclude.

<script type="text/javascript">
<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Abraham Joffe :: http://www.abrahamjoffe.com.au/ */

var startTime=new Date();

function currentTime(){
var a=Math.floor((new Date()-startTime)/100)/10;
if (a%1==0) a+=".0";
document.getElementById("endTime").innerHTML=a;
}

window.onload=function(){
clearTimeout(loopTime);
}

// End -->
</script>

and post this code into the Footer


<div align="center">
<script type="text/javascript">
<!-- Begin
document.write('This Page took <span id="endTime">0.0</span> seconds to load.');
var loopTime=setInterval("currentTime()",100);
// End -->
</script>
</div>



Thats it, short, and sweet enjoy :p

Please Click install if you use this ;)

Original Script Created by : Abraham Joffe

UKBusinessLive
05 Dec 2008, 16:22
Reserved :p

Infopro
05 Dec 2008, 20:27
The first piece if you use this, should go into the headerinclude. In the div for the footer if you added a class="smallfont" it looks a bit nicer. ;)

cbiweb
05 Dec 2008, 23:40
Nice job! (and agrees with Infopro)

*Installed*

UKBusinessLive
06 Dec 2008, 06:25
The first piece if you use this, should go into the headerinclude. In the div for the footer if you added a class="smallfont" it looks a bit nicer. ;)

Thanks for the tip ;)

Infopro
06 Dec 2008, 18:44
Here's one more, there's more than one way to skin a cat:
http://us2.php.net/microtime ;)

punchbowl
06 Dec 2008, 19:12
Why remove the original coders credit? The code was free anyway.

http://javascript.internet.com/text-effects/loading-time-indicator.html

Bounce
06 Dec 2008, 21:07
MY "timer" keeps going and going lol :eek:

vietfancy
07 Dec 2008, 03:55
MY "timer" keeps going and going lol :eek: hahaha you made me laugh, dude.

UKBusinessLive
07 Dec 2008, 07:22
Why remove the original coders credit? The code was free anyway.

http://javascript.internet.com/text-effects/loading-time-indicator.html

Thanks Punchbowl :D

i was sent the code by one of my members without any mention of author or copyright attached to it, I will now add it to the main post.

Why is it that you say i removed the original credit to the author??? In my Snowflake mod i give the author all the credit. Had i known about this one i would of done the same.

Some people don't half jump to conclusions :rolleyes:

UKBusinessLive
07 Dec 2008, 07:24
MY "timer" keeps going and going lol :eek:


For some reason i don't think this quite works if you use the "View website thumbnail" mod, not sure why?? :confused:

Darkstarproject
18 Dec 2008, 03:38
*Uninstalled* - Timer continues to count up.

7lanet
18 Dec 2008, 19:16
^_^

LGKeiz
21 Dec 2008, 02:39
vbseo causes the index timer to continue on and on and on, you need to make it so when the page ends loading, it stops counting.

wingrider
02 Jan 2009, 19:38
Same experience here, and I'm not using vbSEO. It just keeps on counting.

TimberFloorAu
02 Jan 2009, 20:01
Microtime is about the cleanest way of doing this.

Add this to very top of headerinclude ( i think ) above everything else ( must load first )


<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

?>


In footer add:

<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ('Generated in %f seconds.', $totaltime);
?>

LGKeiz
16 Jan 2009, 12:12
php doesn't load properly I think with templates :P

porschinho
28 Jan 2009, 15:22
This has nothing to do with the real load-time of a php based website!
Java script ist interpreted by the client computer, not by the server.
This loadtime indicates how fast your webbrowser displays the page, not how fast the server generates the content...

ZomgStuff
29 Jan 2009, 03:35
Freaking awesome, thank you!
This looks great.
https://www.vbulletin.org/forum/external/2009/01/13.jpg

Edit: nevermind. This fails to stop counting sometimes - uninstalled.

UKBusinessLive
29 Jan 2009, 06:03
Freaking awesome, thank you!
This looks great.
https://www.vbulletin.org/forum/external/2009/01/13.jpg

Edit: nevermind. This fails to stop counting sometimes - uninstalled.

have you tried the code from TimberFloorAu??? above

Microtime is about the cleanest way of doing this.

Add this to very top of headerinclude ( i think ) above everything else ( must load first )



<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

?>

In footer add

<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ('Generated in %f seconds.', $totaltime);
?>

I'll update the code later ;)

Sweeks
04 Feb 2009, 02:11
Neither work properly. The first keeps going and the latter doesnt work at all.
________
Arizona Dispensaries (http://dispensaries.org/)

Welshy2008
14 Jul 2009, 19:55
Unfortunately - I get the same problem. And I have None of the things mentioned in the above threads.

Shame. :(

ubcforums
17 Jul 2009, 17:50
Hi...How can I show number of php and mysql queries :)
Thanks

ubcforums
23 Sep 2009, 03:51
any one ?
THanks

z3r0
23 Sep 2009, 04:54
Hi...How can I show number of php and mysql queries :)
Thanks

The microstats mod shows queries and load time etc. and works with 3.8.x - http://www.vbulletin.org/forum/showthread.php?t=82900

WebkinzCoast
24 Jun 2010, 19:19
Just keeps on counting..... Uninstalled.

Eplexx
12 Nov 2010, 18:04
have you tried the code from TimberFloorAu??? above

Microtime is about the cleanest way of doing this.

Add this to very top of headerinclude ( i think ) above everything else ( must load first )



<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

?>

In footer add

<?
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$totaltime = ($finish - $start);
printf ('Generated in %f seconds.', $totaltime);
?>

I'll update the code later ;)

I tried that and it still counted up, uninstalled.