UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » Script Execution time Mod BETA.

Script Execution time Mod BETA.

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
This is my first mod to this system.
this mod adds in the end of the page a Script Execution time counter.

Install Rate: EASY
instal takes 1 minute.

Step 1

Open index.php
find:

//
// Include the page header
//


add below:

//
// Timer
//

function startTimer()
{
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}
function endTimer()
{
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = round (($endtime - $starttime), 5);
return $totaltime;
}
startTimer();



Find:

require(ROOT_PATH.'sources/page_foot.php');


add after:

echo 'Script Execution time:';
echo endTimer();


THATS IT! HAVE FUN!
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
UseBB already has this functionality, just enable simple debug mode in the ACP
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
where can i do it, i didnt found an option like this...

and one question for you if can i,

why after im updating the config in the ACP, i must to download config.php, and upload to the server.

why it doesnt update it without the uploading?
_______________
Best Regards,
« Last edit by Gil Berger on Fri Apr 27, 2007 5:48 pm. »
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
ACP -> General Configuration -> Advanced settings -> Debug mode

About config.php, check the warning on your ACP index page (make config.php writable).
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Apr 2007
Posts: 29
Location: Haifa, IL
Wow i didnt saw the links up there...
i found, sorry and thanks :).
_______________
Best Regards,

Page: 1

UseBB Community » Resources & Customization » Script Execution time Mod BETA.

UseBB Community is powered by UseBB 1 Forum Software