PDA

View Full Version : Help, Stupid question, How do you (PHP)



F1RULZ
April 12th, 2002, 11:49
How do you get a php script to say how long it took to create(generate) Please Help.

Thanx.

roly
April 12th, 2002, 22:50
in phpBB 2.0 RC-4 (NOT 2.0.0) look in includes/page_footer.php

Jei
April 14th, 2002, 03:30
looks like


<?

$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
printf("<center><font size=-2>phpBB Created this page in %f seconds.</font></center>", $totaltime);

?>

F1RULZ
April 14th, 2002, 12:16
The first one didn't help as I cant find that version and this second one I copyed and tried but didnt work:(

invalid
April 15th, 2002, 18:42
<?php $shorten = microtime(); print ("This Page Took A Mere " . number_format($shorten,3) . " Second To Render.<br>"); ?>

_Street_Fighter
April 15th, 2002, 19:56
heres what i use:

put this BEFORE the <HTML> tag:

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

and put this where u want it to show up:

<?php
$time=explode(' ',microtime());
$time=$time[1]+$time[0];
$a=($time-$the_time_taken);
echo "page generated in <b>$a</b> seconds<br>";
?>

- SF

F1RULZ
April 16th, 2002, 11:10
Thankyou, I'll try those now.