Timer whilst typing, any help??

So i was playing around making a sort of console style game today, but i met a problem that i can't seem to figure out.

I need my code to accept input via cin but also count down/up to a specified number.

then im going to have an if statement saying:

1
2
3
if(timervariable > 0){
    cout << "Well done";
}


Hope you understand me, and are able to help.
You could keep a timer going with another thread, but it's far easier to just take a time stamp when the question is presented and another one after the user enters their answer, the difference between the two is the amount of time elapsed.
the timestamp idea sounds good, i haven't a clue how to do this so time to utilize google. Thanks for the help.
I did something similar a while back. I don't remember the details, but I believe I used

#include <time.h>

I think if you look up that header on this site, you can find some helpful info. Good luck.
Topic archived. No new replies allowed.