Solved

Execution time evaluation

Posted on 2009-05-18
2
234 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
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 150 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 look for a specific file type in a local or remote server directory using PHP.

828 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