I want to generate random numbers between two integer numbers. In my case the numbers must meet some other conditions. I put `generator.nextInt(x)` in a loop and set seed again, if the new number doesn't meet my conditions.

The number which is generated is same in the number of loop iteration when I use `System.currentTimeMillis()` as seed. I replace `System.currentTimeMillis()` with `System.nanoTime()`. the result much better than previous one.

I want to know is there any better way for setting the seed?