I've created a basic application in PHP and would like to print the time it takes to load the page at the end of the page. I first define the start with a microtime and then compare it to the current microtime at the end, the problem is it outputs something like "0.000102" and I'm looking for it in milliseconds, I'm guessing that would be 102ms?
Define the start,
define("START", microtime(true));
Then print the end time.
printf("Page was rendered in %f milliseconds", (microtime(true) - START));
But it still outputs that horrible long string.
See Question&Answers more detail:os