RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

Measure PHP Page Load Time

The following will measure page load time. Handy on MySQL functions, loops, APIs etc.

Place the following at the top of your page (or where you want to measure from).

1
<?php 
2
$time = microtime();
3
$time = explode(' ', $time);
4
$time = $time[1] + $time[0];
5
$start = $time;

Place the following at the bottom of your page (or where you want to measure to).

1
<?php 
2
$time = microtime();
3
$time = explode(' ', $time);
4
$time = $time[1] + $time[0];
5
$finish = $time;
6
$total_time = round(($finish - $start), 4);
7
echo 'Page generated in ' . $total_time . ' seconds.';

It makes sense to write them into functions so you can reuse them.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment