| | |
Groovy website page parse time .. thing
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
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();?>
Similar Threads
- Data parse from web page and load the same into sql server 2005 table (Visual Basic 4 / 5 / 6)
- Selling links on Home page of Various Niche Website with Google Page Rank (Ad Space for Sale)
- Groovy classes visibility within Grails (Java)
- Code Snippet: Groovy website database query counter ..thing (PHP)
- Parse Error message when testing page on browser - HELP!! (PHP)
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube




