javascript - simple jquery second counter -


What is the easiest way to increase a variable in 1 second?

  var counter = 0; Set interval (function () {++ counter;}, 1000);  

Additionally, if you need to turn it off again, it makes this possible:

  var counter = 0; Var myInterval = setInterval (function () {++ counter;}, 1000); // counter to stop interrupt (myInterval);  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -