06-30-2014 03:08 AM
Hi
How to display the "timer" current time?
Currently i using timer in my program, how to display the current time left on the timer to let user know how much time left on the timer?
Is the timer count up or count down?
using TimerCB
can any one advice?
Thanks
ben
Solved! Go to Solution.
06-30-2014 04:32 AM
I am not aware of a possibility to obtain the time until a timer callback will be called, so I would suggest a different approach:
If, say, you want a certain action to happen every 10 minutes but would like to update the UI every second showing the remaining time I would set the timer interval to 1 s. In the timer callback I would use a parameter that will be incremented by one every time the callback is called; if this value reaches 60 x 10 I would reset the parameter and call the function to do the work. In all other cases you would simply need to display 600 - parameter (in seconds) as the remaining time.
An alternative could be to use two timers, one for the action, called every 10 minutes, and one for the UI update, called say every second...