note 85719 added to function.microtime
| From: | christdotborisatnospamgmaildotcom at osu1 dot php dot net | Date: | Sat, 13 Sep 2008 19:39:37 +0000 |
| Subject: | note 85719 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144403@lists.php.net to get a copy of this message | ||
Hi, I made a function to get the generation page time :
<?php
function gentime() {
static $a;
if($a == 0) $a = microtime(true);
else return (string)(microtime(true)-$a);
}
?>
(You can add a round() to the return value if you want)
Use :
<?php
# you should include your libraries/conf files here (including the gentime function)
gentime();
# your source code here
echo 'Generated in '.gentime().' seconds.'
?>
----
Server IP: 89.31.146.176
Probable Submitter: 84.103.188.243
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- https://master.php.net/note/edit/85719
Del: integrated -- https://master.php.net/note/delete/85719/integrated
Del: useless -- https://master.php.net/note/delete/85719/useless
Del: bad code -- https://master.php.net/note/delete/85719/bad+code
Del: spam -- https://master.php.net/note/delete/85719/spam
Del: non-english -- https://master.php.net/note/delete/85719/non-english
Del: in docs -- https://master.php.net/note/delete/85719/in+docs
Del: other reasons-- https://master.php.net/note/delete/85719
Reject -- https://master.php.net/note/reject/85719
Search -- https://master.php.net/manage/user-notes.php