Quote Originally Posted by boozy
Is it possible to make a question with a seartain time to answer it?
Yes it is. The problem you have with "waiting" is that the wait blocks, ie. no other code will run until the wait is done. So you're going to have to do something more than simply wait.

A couple of options:
  • Write a loop which checks the current time against the time when the question was asked. Inside the loop, check to see if the user has pressed a key/given input. Exit the loop when the user has inputted an answer, or when the time check results in a timeout. Then process the result accordingly.
  • Create a thread with a timer in it, and use the main thread to wait for input. If the timeout occurs, the thread exits, and signals the other thread of the timeout.
  • Use the Windows API, and use the Timer functionality (SetTimer(), KillTimer()).


Good luck.