Another little program/game I'm working on in c++ is, how many times can you press the 'Enter' key in 20 seconds. I've made it output a higher number every time you press enter, but I haven't made the timer. How do you do that?
Here's the code I have allready.
How do I get the timer in this code?Code:#include <iostream> #include <ctime> using namespace std; int main() { int press = 0; for(press = 0; press < 1000; press++) { cin.get(); cout << press << endl; } return 0; }
Greatfaith.