I am implementing a program that changes the outcome randomly, so I thought numbers could represent each outcome.
I am computing a random number using ThreadLocalRandom.getCurrent().nextInt(num);
on every iteration, but I found out soon that it is extremely inefficient.
Is there another alternative to generate randomness?
Aucun commentaire:
Enregistrer un commentaire