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.38% (6.14%*) • Home Loan Fixed: 5.44% (6.26%*) • Fixed: 5.44% (6.26%*) • Variable: 5.38% (6.14%*) • Investment IO: 5.69% (6.52%*) • Investment PI: 5.49% (5.98%*)

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 complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

Like this article?

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

Leave a comment