3 ms·
Fair, but rand() is kinda trashy, and the overwhelming part of that cost is fwrite anyway.
by ahh 7y ago
Fair, but rand() is kinda trashy, and the overwhelming part of that cost is fwrite anyway.
- tgsovlerkhgsel 7y agoA large part of the cost being "not random number generation" is part of the point - speed of random number generation generally doesn't matter compared to the speed of what you do with the numbers, and optimizing other things, e.g. how to get the bits converted to random numbers usable by an application, are much more important than quickly generating the random bits.