jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.51k stars 135 forks source link

use monotonic clock #30

Closed srijs closed 6 years ago

srijs commented 7 years ago

fixes #22

jhurliman commented 7 years ago

I like this change, but could getMilliseconds be made to work in the case where process or process.hrtime do not exist?

eaaliprantis commented 7 years ago

What about using Moment.js instead?

jhurliman commented 6 years ago

If anyone has interest in seeing this merged, can you modify the getMilliseconds method to fall back to +new Date() in the case of process or process.hrtime not being defined (i.e. browsers)?

jhurliman commented 6 years ago

Addressed by #44