note 24537 deleted from control-structures.declare by spic
| From: | spic@php.net | Date: | Wed, 28 Aug 2002 08:58:16 +0000 |
| Subject: | note 24537 deleted from control-structures.declare by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35887@lists.php.net to get a copy of this message | ||
Shows how THIS IS not MULTI-TASKING / multi-threading!
<?
function a() {
echo "A - ".getmicrotime()."\n";
}
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
register_tick_function ("a");
declare (ticks=1) {
echo "1 - ".getmicrotime()."\n";
echo "2 - ".getmicrotime()."\n";
echo "3 - ".getmicrotime()."\n";
}
echo "------------------\n";
declare (ticks=3) {
echo "1 - ".getmicrotime()."\n";
echo "2 - ".getmicrotime()."\n";
echo "3 - ".getmicrotime()."\n";
echo "4 - ".getmicrotime()."\n";
echo "5 - ".getmicrotime()." (xtra semicolon)\n";;
echo "6 - ".getmicrotime()."\n";
echo "7 - ".getmicrotime()."\n";
echo "8 - ".getmicrotime()."\n";
}
?>
Results:
Shows how THIS IS not MULTI-TASKING / multi-threading!
1 - 1029879339.4058
A - 1029879339.4059
2 - 1029879339.406
A - 1029879339.406
3 - 1029879339.4061
A - 1029879339.4061
A - 1029879339.4062
------------------
1 - 1029879339.4062
2 - 1029879339.4063
3 - 1029879339.4063
A - 1029879339.4064
4 - 1029879339.4064
5 - 1029879339.4065 (xtra semicolon)
A - 1029879339.4065
6 - 1029879339.4066
7 - 1029879339.4066
A - 1029879339.4067