Forum Moderators: coopster
Can anyone share some tips on how to identify slow code in large php scripts?
I have a "wizard" script - index.php, it includes a seperate php file as the user works through each section of the script. Problem is that sometimes it seems to slow to a crawl when loading session data from mysql. I checked my server load, and it is normal.
Any ideas on how I can figure out what is causing the slow down?
Thanks!
Something like:
$start_time = microtime();
// run script code here
$end_time = microtime();
$total_time = $end_time - $start_time;
There's quite a few code samples on the microtime page that you might find handy.
-sned