Update of the initial approved answer (for future people “Googling” and mo-mo-cut-n-paste):
For PHP 5.X + you need to not only add the “truth” as a parameter for the microtime () microarchive, but we no longer need to divide it by 1000. Therefore, the answer for 2013:
The beginning of the script:
$start = microtime(true);
Bottom of the script:
$end = microtime(true); $creationtime = ($end - $start); printf("Page created in %.6f seconds.", $creationtime);
source share