I have a script that builds my webpage in one string ($content) and then echo it to the user.
My script looks like this:
$time1= microtime(true);
$conten
If this is dedicated server - please login to console and see which process uses a lot of cpu time when you generating content. Its very hard to tell, when we cant see code. Maybe you just need some indexes in database, or maybe you should remove some indexes.
You can also check httpd and mysqld log files.