note 19243 deleted from function.mt-srand by zak
| From: | zak@php.net | Date: | Wed, 20 Feb 2002 19:09:13 +0000 |
| Subject: | note 19243 deleted from function.mt-srand by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-26861@lists.php.net to get a copy of this message | ||
list($usec,$sec) = explode(" ",microtime());
/* Test: Each get rand sequence are 10time. */
/* ex) 5.3point meaning 5point integer + 3point decimal
// case A:
// 5.0point - 1time
// 6.0point - 9time
$rand = (double)microtime()*1000000;
// case B:
// 8.6point - 1time
// 9.4point - 1time
// 9.5point - 7time
// 10.3point - 1time
$rand = (double)$sec * $usec;
// My case A:
// 8.0point - 10time
$rand = explode(".",$usec * $sec);
$rand = $rand[0] * $rand[1];
$rand = (double)substr($rand,0,8);
// My case B:
// 9.0point - 9time
// 10.0point - 1time
$rand = explode(".",$usec * $sec);
$rand = $rand[0] + $rand[1];
$rand = (double)microtime()*1000000;
mt_srand($rand);
srand($rand);