0 votes
33 views
asked in General by
How can I calculate the time taken to execute a page of code?

1 Answer

0 votes
answered by
If what you are looking for is the wall-clock time, rather than the CPU execution time, then here is simple code to calculate:

Place this at the top of your page

$time_start     = microtime(true);

and this at the very bottom of that page.

echo "<br><b>Process took ". number_format(microtime(true) - $time_start, 2). " seconds.</b>";

and thats it!

Related questions

0 votes
1 answer 568 views
0 votes
1 answer 364 views
asked Jun 21, 2016 in General by mithunrockey (560 points)
0 votes
1 answer 65 views
0 votes
2 answers 1.1k views
asked Oct 26, 2016 in Modules by Octavia
0 votes
1 answer 214 views
asked Aug 1, 2016 in Joomla by Justin
0 votes
1 answer 343 views
...