Converts common units of time to milliseconds
A small library for creating and using time intervals using common units of time instead.
npm install interval or add
interval as a dependency in your
package.json file and
var interval = require'interval';// set timeouts and intervals more literatelysetTimeoutfoo interval hours: 2 ;// the date 10 days from todayvar deadline = intervaladd days: 10 ;
The supported units of time are 'days', 'hours', 'minutes', 'seconds' and 'milliseconds'. You can use as many or as few units as you want and they are applied cumulatively.