title: Use of qsrand, random method that is not random
body: <p>I'm having a strange problem here, and I can't manage to find a good explanation to it, so I thought of asking you guys :</p>
  
  <p>Consider the following method :</p>
  
  <pre><code>int MathUtility::randomize(int Min, int Max)
  {
      qsrand(QTime::currentTime().msec());
  
      if (Min &gt; Max)
      {
          int Temp = Min;
          Min = Max;
          Max = Temp;
      }
      return ((rand()%(Max-Min+1))+Min);
  }
  </code></pre>
  
  <p>I won't explain you gurus what this method actually does, I'll instead explain my problem :</p>
  
  <p>I realised that when I call this method in a loop, <strong>sometimes</strong>, I get the same random number over and over again... For example, this snippet...</p>
  
  <pre><code>for(int i=0; i&lt;10; ++i)
  {
      int Index = MathUtility::randomize(0, 1000);
      qDebug() &lt;&lt; Index;
  }
  </code></pre>
  
  <p>...will produce something like :</p>
  
  <p>567
  567
  567
  567...etc...</p>
  
  <p>I realised too, that if I don't call qsrand everytime, but only once during my application's lifetime, it's working perfectly... </p>
  
  <p>My question : Why ?</p>