I would like to ask how can I make a console game when I need the user to input some string within a period of time? (I’ve tried to use Sleep function but it will make the screen freeze for a period of time which I don’t want to)
Example : A Pop Quiz
I think this can be done without multithreading (A very simple version of a timer)
You can try to write something like this and modify it to serve your needs:
Please note that the code is not complete. You need to edit it so it match your needs. However, this should give you an idea.
Some documentations:
Return difference between two times
Calculates the difference in seconds between time1 and time2.