setInterval(function() {
var current = ? getCurrentInterval ? ;
alert(current);
}, 2000);
Is possible to check?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s nothing that will give you the “current” interval, as there might be several distinct timers running. You might be better off constructing your own
Timerclass that stores the interval and that you can later query.You’re going to have to be a little creative with Javascript’s scoping contexts if you have multiple timers and need to access the relevant
Timerinside your callback. Something along these lines: