Small time unit conversion library inspired by Java's TimeUnit
It is really small: 296 bytes minified and gzipped
var s = TimeUnit.HOURS.toSeconds(1); // s = 3600;
setTimeout(function(){...}, TimeUnit.SECONDS.toMillis(15));
The following units can be used:
- MILLIS
- SECONDS
- MINUTES
- HOURS
- DAYS
To develop
git clone https://github.com/rideg/TimeUnit.js.git
cd TimeUnit.js
npm install
grunt