Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 497 Bytes

18-timer.md

File metadata and controls

20 lines (14 loc) · 497 Bytes
title signature
Timer
npm install moment-timer

This is a Moment.js plugin that allows the use of timers, which offer much more control than the native JavaScript timers. It's basically a rewrite of JavaScripts own setInterval and setTimeout.

For example,

var timer = moment.duration(5, "seconds").timer({loop: true}, function() { 
  // Callback 
});

The repository is located at github.com/SeverinDK/moment-timer