Timing Script Returns -ve Result ??
| From: | Wingo Chan | Date: | Sat, 14 Oct 2000 05:56:09 +0000 |
| Subject: | Timing Script Returns -ve Result ?? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3237@lists.php.net to get a copy of this message | ||
Hi,
I wanted to time my codes using the following:
$starttime = explode(' ', microtime());
.
code block
.
$endtime = explode(' ', microtime());
$parsed_time = ($endtime[1]-$starttime[1])+($endtime[0]-$starttime[0]);
echo $parsed_time;
Every few runs would return a negative $parsed_time. I echoed the results and found that it was due
to $endtime[1]==$starttime[1] AND $endtime[0] < $starttime[0] !!
Any hints will be highly appreciated.
Wingo Chan
PHP Newbie