0 votes
899 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 597 views
0 votes
1 answer 389 views
asked Jun 22, 2016 in General by mithunrockey (610 points)
+1 vote
1 answer 383 views
0 votes
1 answer 1.8k views
0 votes
2 answers 1.3k views
asked Oct 27, 2016 in Modules by Octavia
0 votes
1 answer 276 views
asked Aug 2, 2016 in Joomla by Justin
...