I need a few lines of Java code that run a command x percent of the time at random.
psuedocode:
boolean x = true 10% of cases. if(x){ System.out.p
You have to define "time" first, since 10% is a relative measure...
E.g. x is true every 5 seconds.
Or you could use a random number generator that samples uniformly from 1 to 10 and always do something if he samples a "1".