vendredi 17 juillet 2015

C++ & Qt: Don't pick a random number for x minutes

Let's say i have 10 numbers from 1 to 10 and rand() picks number 3. The number will be displayed on my screen, but won't be shown for another 15 minutes after it was picked. How can i do that?

I know srand should be used for better random results, but that's not what I want to achieve. I want a specific number to be shown once, but after that it will not appear until 15 minutes are gone. I've read something about sleep, but I haven't figured out how that works and if it fits to my problem.




Aucun commentaire:

Enregistrer un commentaire