How to restrict user to not to give input after a certain period? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to restrict user to not to give input after a certain period?

i want to build a quiz in which the user is given limited time for input and once the time is over the program move to the next question

27th Jan 2017, 5:23 AM
nitesh
3 Answers
+ 6
I had the same question of doing this in C++. Multi-threading will do the job, but if that is unfamiliar, the alternate trick is to get system time before answering quiz, store system time into a variable and then get system time after user answers the quiz. Compare the two and disqualify he user if time is more than n seconds.
27th Jan 2017, 5:43 AM
Hatsy Rei
Hatsy Rei - avatar
0
but what i really want to skip that unnecessary input part
27th Jan 2017, 5:47 AM
nitesh
0
try sleep function..
27th Jan 2017, 6:31 AM
Deepanshu niwati
Deepanshu niwati - avatar