We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

ibomb on 04/29/08


Tagged

php time script execution


Versions (?)


Calculating script execution time


Published in: PHP 


URL: blog.doguki.com

  1. <?php
  2. $start = (float) array_sum(explode(' ',microtime()));
  3.  
  4. // put you code that wanted to render at here
  5.  
  6. $end = (float) array_sum(explode(' ',microtime()));
  7.  
  8. echo "Processing time: ". sprintf("%.4f", ($end-$start))." seconds";
  9. ?>

Report this snippet 

You need to login to post a comment.