Hello,

I'm using the code shown to generate random numbers.
Qt Code:
  1. timeval ti;
  2.  
  3. gettimeofday(&ti, NULL);
  4. qsrand(qsrand((long long)ti.tv_usec * (long long)ti.tv_sec);
  5. qDebug() << (long long)((long long)ti.tv_usec * (long long)ti.tv_sec);
  6.  
  7. num = (rand() % maxNum + 1);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. 1151813750172254
  2. 1152103117531054
  3. 1020841750830240
  4. 1033346761335855
To copy to clipboard, switch view to plain text mode 

Is there any difference to the result in using:-
Qt Code:
  1. qsrand((long long)ti.tv_usec * (long long)ti.tv_sec);
To copy to clipboard, switch view to plain text mode 
against
Qt Code:
  1. qsrand(ti.tv_usec * ti.tv_sec);
To copy to clipboard, switch view to plain text mode 

Both seem to give acceptable results.

Regards