note 24537 added to control-structures.declare

From: Date: Tue, 20 Aug 2002 21:29:58 +0000
Subject: note 24537 added to control-structures.declare
Groups: php.notes 
Request: Send a blank email to php-notes+get-35270@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 -- http://www.php.net/manual/en/control-structures.declare.php http://master.php.net/manage/user-notes.php?action=edit+24537 http://master.php.net/manage/user-notes.php?action=delete+24537 http://master.php.net/manage/user-notes.php?action=reject+24537

« previous php.notes (#35270) next »