?
Solved

Execution time evaluation

Posted on 2009-05-18
2
Medium Priority
?
248 Views
Last Modified: 2012-05-07
hi,

I use XAMPP  to run PHP.  I want to know the functions available for evaluate  execution time and little explanation for how can use that and occations that we can use that functions.  
0
Comment
Question by:shaf81
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 1050 total points
ID: 24411948

<?php
$time_start = microtime(true);//record start time
 
//repeat 10000 time
$i = 10000;
while ($i--) {
	//process
}
 
$time_end = microtime(true);//record end time
 
//calculate and format output
$time = number_format(($time_end - $time_start) * 1000,4);
echo "execution time : $time ms\n";
?>

Open in new window

0
 
LVL 4

Assisted Solution

by:max-hb
max-hb earned 450 total points
ID: 24412494
Hi!
If you need a more sophisticated profiling tool take a look at http://freshmeat.net/projects/phpprofiler/

phpprofiler offers you several options to fine tune profiling and enables you to measure performance of nested blocks.

CU
 maxhb
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question