fast-date
High Speed UTC Timestamps
Supports
- Node 6
- Node 8
- Node 10
Benchmarks
npm run bench
NativeDate*100000: 175.776ms
FastDateUnix*100000: 98.684ms
FastDateUtc*100000: 96.166ms
DateNow*100000: 107.326ms
TimerNow*100000: 105.762ms
fast-date
is about as fast at providing UTC timestamps as Date.now
is at providing millisecond epochs.
Usage
var fastDate = var http = http
Options
format
Set the output, current options:
utc
output a UTC timestampunix
output seconds since the unix Epoch
var fastDate = format: 'unix'
prefix & suffix
Add strings before and after:
var fastDate = prefix: 'some text before' suffix: 'some text after'
Tests
npm test
Coverage
npm run cov
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|
More Benchmarks
For effects on an HTTP server:
npm run bench-http
License
MIT
Acknowledgements
Sponsored by nearForm