How costly it is to generate a random number in terms of CPU usage? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How costly it is to generate a random number in terms of CPU usage?

8th Mar 2017, 2:53 PM
Shahar Levy
Shahar Levy - avatar
2 Answers
+ 8
Depends on the implementation used. See here for pros/neutrals/cons to get an idea (in other words...which algorithm?) http://www.pcg-random.org/other-rngs.html c# reference (Random class? or System.Security.Cryptography...? Perfmon might help here) http://stackoverflow.com/a/23481245/3981745
8th Mar 2017, 3:27 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
C# Random. It's very useful for Unity.
8th Mar 2017, 4:37 PM
Shahar Levy
Shahar Levy - avatar