php测试代码:
echo microtime().'<br/>';
mt_rand(0,9);
echo microtime().'<br/>';
echo microtime().'<br/>';
rand(0,9);
echo microtime();
测试结果:
0.40673600 1350455889
0.40675100 1350455889
0.40675500 1350455889
0.40676000 1350455889
mt_rand 比rand效率高3倍!