Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 494 Bytes

19-timer.md

File metadata and controls

19 lines (14 loc) · 494 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.