you can call rand() as fast as you want and it will give you a different "random" number each time. That's the whole concept behind random numbers.
this is works just fine.
Code:
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
int main()
{
// this seeds rand()
// you can put anything you want as a seed but typically you use system time
srand(time(NULL));
// now make random numbers
for(int i = 0; i < 20; ++i)
{
cout << rand() << endl;
}
return 0;
}
Now unless you have a very slow computer each number should be generated in much less than 1 second and they will statistically be different.
Note: As in all of the other posts in the past week regarding random numbers (perhaps people should use the search feature?) rand() is a pseudo random generator, which means that it will produce the same sequence with a given seed. Each number will of course be random though.