note 97809 added to function.sleep
| From: | toddjt78 at msn dot com | Date: | Mon, 10 May 2010 02:39:37 +0000 |
| Subject: | note 97809 added to function.sleep | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169101@lists.php.net to get a copy of this message | ||
Simple function to report the microtime since last called or the microtime since first called.
function stopWatch($total = false,$reset = true){
global $first_called;
global $last_called;
$now_time = microtime(true);
if ($last_called === null) {
$last_called = $now_time;
$first_called = $now_time;
}
if ($total) {
$time_diff = $now_time - $first_called;
} else {
$time_diff = $now_time - $last_called;
}
if ($reset)
$last_called = $now_time;
return $time_diff;
}
$reset - if true, resets the last_called value to now
$total - if true, returns the time since first called otherwise returns the time since last called
----
Server IP: 64.71.164.2
Probable Submitter: 66.152.121.82
----
Manual Page -- http://www.php.net/manual/en/function.sleep.php
Edit -- https://master.php.net/note/edit/97809
Del: integrated -- https://master.php.net/note/delete/97809/integrated
Del: useless -- https://master.php.net/note/delete/97809/useless
Del: bad code -- https://master.php.net/note/delete/97809/bad+code
Del: spam -- https://master.php.net/note/delete/97809/spam
Del: non-english -- https://master.php.net/note/delete/97809/non-english
Del: in docs -- https://master.php.net/note/delete/97809/in+docs
Del: other reasons-- https://master.php.net/note/delete/97809
Reject -- https://master.php.net/note/reject/97809
Search -- https://master.php.net/manage/user-notes.php