Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on calibrations and measurements tests using a tool INCA from ETAS. I have a measure window to Display the values of variables. When I pause the measurement and again want to start at the same time interval, I am unable to do. It takes the universal System time and Plays again from that time interval. So, how can I implement a Backcounting timer? Any help would be appreciated.

What I have tried:

I really do not have any idea to try
Posted
Updated 23-Sep-16 0:24am
Comments
CPallini 23-Sep-16 3:10am    
Could you please elaborate? For instance what OS are you developing for?
[no name] 23-Sep-16 6:27am    
One idea would be to do a bit of research, I found http://www.codeproject.com/Tips/82005/A-count-down-timer-in-c in about 10 seconds of googling.

1 solution

It is a problem of your design. Normally is some class design implemented which enhances clarity. I guess you need a function "RestartTimer" which creates a brand new timer.

A backcounting timer is done by calculating the end time (in the future) and substract the actual time.

In Windows you have the SetTimer which is normally used in 1 second interval to update the user interface. Important is to know that you cant rely on the precision of that interval, so calculate your interval in own time variables!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900