i whant a code in which the timer should strat as soon as the aode gets started and if the user press any key,hte timer should stop and should display the time taken in seconds.
How to get timer time in c++?
This code depends on which environment you are developing. The interfaces/API for creating timers are difference under UNIX, Windows, and etc.
Here's a few links:
http://www.codersource.net/mfc_working_w...
http://code.dreamincode.net/snippet38.ht...
http://ourworld.compuserve.com/homepages...
Basically, you are going to do the following:
1. Set your timer via callign some function.
2. Enter a while-loop where you check command-line and etc for user input. Once the user pressed a key or something, you can detect it then disable the timer.
I hope this helps.
-Leon S
salary survey
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment