•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,571 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,649 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Well like my previous snippet but completing the collection i suppose, this snippet counts how long it takes to parse the page and displays it somewhere..
// First you need to include the functions in the header or something // timer start function function startTimer() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; } // timer end function function endTimer() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = round (($endtime - $starttime), 5); return $totaltime; } // now at the start of your header usually immediatly after these // functions. start the timer with... startTimer(); // all you do now is output it on your page somewhere using this Page Generation time: <?=endTimer();?>
Comments (Newest First)
mohamed badr | Newbie Poster | Mar 15th, 2008
•
•
•
•
i think it's not accurate
Troy | Posting Whiz | May 23rd, 2006
•
•
•
•
Useful, clean, and simple. I like it.
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)