Skip to content

add millisecond range#47

Closed
galkn wants to merge 2 commits intosindresorhus:masterfrom
galkn:delay-range
Closed

add millisecond range#47
galkn wants to merge 2 commits intosindresorhus:masterfrom
galkn:delay-range

Conversation

@galkn
Copy link
Copy Markdown

@galkn galkn commented Jul 26, 2019

In many applications it's useful to delay promises by different amounts of time within a defined range (one example is web scrapers). This PR makes a suggestion to include this capability in the module by having delay take in a second optional milliseconds parameter, which together with the required first value formulate the range from which a random number will be used to delay the promise.

@sindresorhus
Copy link
Copy Markdown
Owner

I agree this could be useful, but it should be a separate method.

@sindresorhus
Copy link
Copy Markdown
Owner

@galkn Do you think you would be interested in finishing this or should I close? :)

@galkn galkn closed this Jul 15, 2020
@galkn galkn deleted the delay-range branch July 15, 2020 15:11
@sindresorhus sindresorhus mentioned this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants