Jump to content

Archived

This topic is now archived and is closed to further replies.

Gregg

Display Load Time?

Recommended Posts

Ok, here is a question i havent figured out in a while.
How do i display the load time of the curent "Page", like:
[b][color=red]It Took 4.9 Seconds To Load Results.[/color][/b]

I remember doing it years back but i dont want it in js but php. ???

Share this post


Link to post
Share on other sites
Here is what a quick google search rendered:

[code]
<?php
$starttime = microtime();
$startarray = explode(" ", $starttime);
$starttime = $startarray[1] + $startarray[0];

echo "content etc";

$endtime = microtime();
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,5);
echo "This page loaded in $totaltime seconds.";
?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.