I am trying to generate random numbers between 10 and 20. I have used srand(time(0)) and called it once before the for loop. As the program program run faster, the for loop is probably getting same seed. To overcome, I used sleep(1000) for every iteration the rand() is called. I am not expecting all unique values, as it should not be, but I get 1 sec delay. Is there any better approach ? Thank you for reading.