I have made a basic timer in c++ which gets an initial time and stores it in a time_t variable. I then get the current time and use difftime() to see the difference between the two variables in seconds so I can gauge how long the timer has been running for.
What I want to do with this is start the timer after the user has inputting an action and then if nothing has been entered after a certain amount of time, exit. I am using readLine() to get the user input which obviously just waits and doesn't continue with the other code so I cannot check the timer. I thought I would need to use threads so the main can still function as normal and the timer can still count in the background but C++ does not directly support threads?
What would you guys suggest I do to tackle this?
Cheers
What I want to do with this is start the timer after the user has inputting an action and then if nothing has been entered after a certain amount of time, exit. I am using readLine() to get the user input which obviously just waits and doesn't continue with the other code so I cannot check the timer. I thought I would need to use threads so the main can still function as normal and the timer can still count in the background but C++ does not directly support threads?
What would you guys suggest I do to tackle this?
Cheers