Solved

Execution time evaluation

Posted on 2009-05-18
2
224 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
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 350 total points
Comment Utility

<?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 150 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now