note 29313 added to function.microtime
| From: | master at xyborx dot dk | Date: | Sun, 09 Feb 2003 18:33:37 +0000 |
| Subject: | note 29313 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43699@lists.php.net to get a copy of this message | ||
If anybody is looking for a simple generation-time counter, this might work for you:
list($foo,$bar)=explode(' ',microtime());
$timer_start=$foo+$bar;
unset($foo);
unset($bar);
-- all you code goes here --
list($foo,$bar)=explode(' ',microtime());
$timer_end=$foo+$bar;
unset($foo);
unset($bar);
echo 'Generation time: '.round($timer_end-$timer_start,5).' seconds';
There might be a more effecient way of doing it, but at the moment, it works fine for me :)
--
http://www.php.net/manual/en/function.microtime.php
http://master.php.net/manage/user-notes.php?action=edit+29313
http://master.php.net/manage/user-notes.php?action=delete+29313
http://master.php.net/manage/user-notes.php?action=reject+29313