//At the start of the script.
$filename = "timings.log";
if (!file_exists($filename)) {
touch($filename);
}
$timings = fopen($filename,"a");
fwrite($timings,date("g:i:s:u a")."\n\r");
//PHP body...
//At the end of the script
fwrite($timings,date("g:i:s:u a")."\n\r\n\r");
fclose($timings);