Re: [PHP] Getting the parsing time of a script

2003-05-31 Thread David Otton
On Sat, 31 May 2003 11:39:41 +0100, you wrote:

Is there any way getting the time taken to parse a script?

IE:

This page took 0.13 seconds to generate.

Call microtime() at the beginning and end of the script.

$timeTaken = $timeEnd - $timeStart;

see

http://uk2.php.net/manual/en/function.microtime.php

and read the comments.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Getting the parsing time of a script

2003-05-31 Thread Ernest E Vogelsinger
At 12:39 31.05.2003, Bix said:
[snip]
Is there any way getting the time taken to parse a script?

IE:

This page took 0.13 seconds to generate.

Is it a predefined variable anywhere?
[snip] 

$start = microtime();
for ($i = 0; $i  1; ++$i)
$n = getdate(time());
$end = microtime();
list($s0, $s1) = explode(' ', $start);
list($e0, $e1) = explode(' ', $end);
echo sprintf('hrThis page took %.2f seconds to generate',
($e0+$e1)-($s0+$s1));


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php