| | |
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 |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple multipletables mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validator variable video web xml youtube



