C ++ implementation stopwatch

Download the full code

Ideas summarize: If a key is pressed, to determine what key is pressed and processed. No key is pressed, timing. Traditional Sleep unable to meet the stopwatch is accurate to one millisecond demand, where the use of more accurate clock, the clock is the role of statistics from the program starts to run to the present time. So stopwatch time calculation formula: Start from the program to the present time - the time it takes before timing pretreatment. Timing pretreatment before seeking to spend time just call it again before you can find the timing clock.

Run shot (Screen):

Again: open source does not mean you can ignore copyright, please indicate the source, this is the bottom line! !

Guess you like

Origin www.cnblogs.com/eason66-blog/p/stopwatch.html