Possible Duplicate:
Javascript: find the time left in a setTimeout()?
I’m trying to use setTimeout() as a way of pausing a series of events in JS.
Here’s an example of what I’m doing and what I’d like to do in comments – http://jsfiddle.net/8m5Ww/2/
Any suggestions how I can populate var timeRemaining with the total milliseconds remaining in var a?
You can’t get directly the timer remaining seconds.
You can save in a variable the timestamp when the timer is created and use it to calculate the time to the next execution.
Sample: