Pourquoi mt_rand plutot que rand ? Trop lent ? Trop mauvais ? Pas
testé ?
J'ai fait ce test :
?
$nb_accu = 100;
$nb_run = $nb_accu * 150;
for ($i=0; $i$nb_run; $i++) {
$accu[ mt_rand(0, $nb_accu) ] ++;
}
for ($i=0; $i$nb_accu; $i++) {
if (!isset($min) || $accu[$i]$min) {
$min =
Le 12515ième jour après Epoch,
Cedric Cellier écrivait:
Pourquoi mt_rand plutot que rand ? Trop lent ? Trop mauvais ? Pas
testé ?
Euh... D'après la doc php, mt_rand est ... mieux. Alors j'ai pris le
mieux. En plus, mersenne est le nom de mon ancien serveur, alors c'est
une forme d'hommage :)
2 matches
Mail list logo