Time That
A simple module to print elapsed time from one date to another.
I use this in several of my CLI tools and figured I should export it and not just copy it.
Install
npm i timethat
Usage
var timethat = require('timethat'),
start = new Date('1/1/2010 3:00:00'),
end = new Date('1/1/2010 5:43:21');
console.log(timethat.calc(start, end));
var start = new Date('1/1/2010 3:00:00'),
end = new Date('1/1/2010 3:21:02');
console.log(timethat.calc(start, end));
console.log(timethat.calc(1262336400000, 1262336400150));
You can give it seconds or Date
objects.
Build Status
Currently at 100% code coverage, reports are in the Travis builds.