Forum Moderators: coopster
For example:
FILE #1
--------------
<?php
include "header.php";
include "menu.php";
?>
CONTENT HERE
<?php
include "footer.php";
?>
--------------
or
FILE #2
--------------
<?php
include "master.php";
header();
menu();
?>
CONTENT HERE
<?php
footer();
?>
--------------
In other words, does it take the server longer to request 3 files, or request 1 file and call 3 functions?
Are you having problems with speed on you present setup?
really wouldn't know how to measure it
There is nothing mysterious about benchmarking. If you know how to time how long it takes you to get from home to work you know how to benchmark.
1. Get current time.
2. Do something.
3. Get current time.
4. Calculate difference between 3 and 1.
In php terms do something like this:
function getmicrotime($t) {
list($usec, $sec) = explode(" ",$t);
return ((float)$usec + (float)$sec);
} $start = microtime();
// do your includes here
$end = microtime();
$diff = getmicrotime($end) - getmicrotime($start);
To increase accuracy and if runtime is very low put the code in a loop and run it 100 times. Also remember that the runtime depends on the load of your server and a lot of other factors you need to take into consideration.
Andreas
[zend.com...]
If you're really in a techie mood, see also
[phplens.com...]
and
[php.weblogs.com...]
Tom