title: srand(time(NULL)) doesn't change seed value quick enough
body: <p>I have written a simple random number generator in C. <code>int l</code> is the lower bound and <code>int u</code> is the upper bound.</p>
  
  <p>It works just fine, however I have a question regarding seeding it. If I was to run this in a loop, <code>time(NULL)</code> doesn't change the seed value quick enough to be able to prevent getting a consecutive series of random numbers that are exactly the same.</p>
  
  <p>I'm wondering how anybody else might have approached this problem. All the examples I've found online use <code>time(NULL)</code> as the seed value generator.</p>
  
  <pre><code>int generateRandom(int l, int u)
  {
     srand(time(NULL));
  
     int r = rand() % ((u - l) + 1);
     r = l + r;
  
     return r;
  }
  </code></pre>
  
  <p>If I was to run these lines of code right next to each other, both <code>Rand1</code> and <code>Rand2</code> would be exactly the same.</p>
  
  <pre><code>printf("Rand1 = %d\n", generateRandom(10, 46));
  printf("Rand2 = %d\n", generateRandom(10, 46));
  </code></pre>