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. ??? Link to comment https://forums.phpfreaks.com/topic/20187-display-load-time/ 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] Link to comment https://forums.phpfreaks.com/topic/20187-display-load-time/#findComment-88780 Share on other sites More sharing options...
Gregg Posted September 9, 2006 Author Share Posted September 9, 2006 Thanks, worked great. :D Link to comment https://forums.phpfreaks.com/topic/20187-display-load-time/#findComment-88787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.