Cheap and cheerful rand() replacement

2019-04-22 04:41发布

After profiling a large game playing program, I have found that the library function rand() is consuming a considerable fraction of the total processing time. My requirements for the random number generator are not very onerous - its not important that it pass a great battery of statistical tests of pure randomness. I just want something cheap and cheerful that is very fast. Any suggestions?

标签: c random
7条回答
贪生不怕死
2楼-- · 2019-04-22 05:43

This may not be a great answer, and is really more of a question.

Depending on the platform and the frequency of depending on the value, wouldn't the least significant numbers of a microsecond returning function approximate something 'random'?

查看更多
登录 后发表回答