vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Board Optimization - Forum Load Time Indicator (https://vborg.vbsupport.ru/showthread.php?t=198078)

UKBusinessLive 12-04-2008 10:00 PM

Forum Load Time Indicator
 
1 Attachment(s)
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.

Code:

<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

Code:

<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 12-05-2008 03:22 PM

Reserved :p

Infopro 12-05-2008 07:27 PM

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 12-05-2008 10:40 PM

Nice job! (and agrees with Infopro)

*Installed*

UKBusinessLive 12-06-2008 05:25 AM

Quote:

Originally Posted by Infopro (Post 1679244)
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 12-06-2008 05:44 PM

Here's one more, there's more than one way to skin a cat:
http://us2.php.net/microtime ;)

punchbowl 12-06-2008 06:12 PM

Why remove the original coders credit? The code was free anyway.

http://javascript.internet.com/text-...indicator.html

Bounce 12-06-2008 08:07 PM

MY "timer" keeps going and going lol :eek:

vietfancy 12-07-2008 02:55 AM

Quote:

Originally Posted by hIBEES (Post 1679829)
MY "timer" keeps going and going lol :eek:

hahaha you made me laugh, dude.

UKBusinessLive 12-07-2008 06:22 AM

Quote:

Originally Posted by punchbowl (Post 1679751)
Why remove the original coders credit? The code was free anyway.

http://javascript.internet.com/text-...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 12-07-2008 06:24 AM

Quote:

Originally Posted by hIBEES (Post 1679829)
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 12-18-2008 02:38 AM

*Uninstalled* - Timer continues to count up.

7lanet 12-18-2008 06:16 PM

^_^

LGKeiz 12-21-2008 01:39 AM

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 01-02-2009 06:38 PM

Same experience here, and I'm not using vbSEO. It just keeps on counting.

TimberFloorAu 01-02-2009 07:01 PM

Microtime is about the cleanest way of doing this.

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

Code:

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

?>

In footer add:
Code:

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


LGKeiz 01-16-2009 11:12 AM

php doesn't load properly I think with templates :P

porschinho 01-28-2009 02:22 PM

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 01-29-2009 02:35 AM

Freaking awesome, thank you!
This looks great.
https://vborg.vbsupport.ru/external/2009/01/13.jpg

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

UKBusinessLive 01-29-2009 05:03 AM

Quote:

Originally Posted by ZomgStuff (Post 1727742)
Freaking awesome, thank you!
This looks great.
https://vborg.vbsupport.ru/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 )


Code:

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

?>

In footer add

Code:

<?
$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 02-04-2009 01:11 AM

Neither work properly. The first keeps going and the latter doesnt work at all.
________
Arizona Dispensaries

Welshy2008 07-14-2009 06:55 PM

Unfortunately - I get the same problem. And I have None of the things mentioned in the above threads.

Shame. :(

ubcforums 07-17-2009 04:50 PM

Hi...How can I show number of php and mysql queries :)
Thanks

ubcforums 09-23-2009 02:51 AM

any one ?
THanks

z3r0 09-23-2009 03:54 AM

Quote:

Originally Posted by ubcforums (Post 1850655)
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 - https://vborg.vbsupport.ru/showthread.php?t=82900

WebkinzCoast 06-24-2010 06:19 PM

Just keeps on counting..... Uninstalled.

Eplexx 11-12-2010 05:04 PM

Quote:

Originally Posted by UKBusinessLive (Post 1727827)
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 )


Code:

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

?>

In footer add

Code:

<?
$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.


All times are GMT. The time now is 04:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01208 seconds
  • Memory Usage 1,779KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete