Page execution time PHP

Last day we show how to count your Sql queries on PHP. Today we do 1 step more in your app to know how long does it takes to be executed in the server (just to return the html to the browser).

This is kind of important, at least to me to see that everything is going as expected.

I will show you one way of doing this, really easy!

On the start of your code paste this:

$start_time=microtime(true);

Then all your code, html php etc…

In the footer of your html you can display it like this:

echo "Total exectution time:".round((microtime(true)-$start_time),3);

I mean this is really simple….but useful, or not? ;)

Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • BarraPunto
  • Bitacoras.com
  • FriendFeed
  • Meneame
  • Netvibes
  • Reddit
  • StumbleUpon
  • Tumblr
  • Wikio
  • RSS
  • email
  • PDF
  • Print

Related posts:

  1. Simple pagination for PHP
  2. Print folder contents recursive with indent – PHP
  3. Send email using Gmail and PHP
  4. Error reporting for PHP
  5. webLab – Create your own php-html lab

Leave a Reply

Follow me