You could test the execution time for each part of your script to see what part take the longest. For example the time to create a object, retreive results from a class, echo out the results, etc.
here is the execution script I use: (found it somewhere)
function e_start ($name = 'default') {
global $ss_timing_start_times;
$ss_timing_start_times[$name] = explode(' ', microtime());
}
function e_stop ($name = 'default') {
global $ss_timing_stop_times;
$ss_timing_stop_times[$name] = explode(' ', microtime());
}
function e_current ($name = 'default') {
global $ss_timing_start_times, $ss_timing_stop_times;
if (!isset($ss_timing_start_times[$name])) {
return 0;
}
if (!isset($ss_timing_stop_times[$name])) {
$stop_time = explode(' ', microtime());
}
else {
$stop_time = $ss_timing_stop_times[$name];
}
// do the big numbers first so the small ones aren't lost
$current = $stop_time[1] - $ss_timing_start_times[$name][1];
$current += $stop_time[0] - $ss_timing_start_times[$name][0];
return $current;
}
use it like this:
e_start("object");
.. your object script
e_stop("object");
e_start("retreive");
.. your script
e_stop("retreive");
e_start("echo");
.. echo out
e_stop("echo");
// output the results
echo "Object = ".e_current("object")."<br>;
echo "Retreive = ".e_current("retreive")."<br>;
echo "Echo = ".e_current("echo");