Gregg Posted September 9, 2006 Share Posted September 9, 2006 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. ??? Quote Link to comment Share on other sites More sharing options...
hostfreak Posted September 9, 2006 Share Posted September 9, 2006 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] Quote Link to comment Share on other sites More sharing options...
Gregg Posted September 9, 2006 Author Share Posted September 9, 2006 Thanks, worked great. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.