Simple pure Javascript timer.
Just a wrapper for setTimeout
, clearTimeout
functions with human-readable
interfaces.
// Define a new deferred task
var task = new Timer(function() { console.log('DONE'); }, 5e3);
// then pause for some reasons
task.pause()
// and resume
task.resume()
// or even restart
task.restart();
Licensed under the MIT license.
Copyrights © 2013 by Vital Kudzelka [email protected].