Re: processing time
| From: | David Tod Sigafoos | Date: | Wed, 20 Dec 2000 19:44:23 +0000 |
| Subject: | Re: processing time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31297@lists.php.net to get a copy of this message | ||
CH> does anyone know how to determine how long a script takes to execute?
CH> i guess i would like to be able to determine exactly how much time scripts
CH> take to return a request or something similar. i have seen this b4 on
CH> websites but can't seem to find any info for php anywhere.
This is pretty standard in all languages .. problem in php is the way
it handles time .. but here you go this *should* work
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
?>
do some neat html stuff here
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
?>
--
DSig
David Tod Sigafoos
mailto:dsig@teleport.com
Using 'The Bat' 1.48 Beta/11
`````
( O O )
_______oOOo__( )__oOOo_______