Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use milliseconds instead of seconds #1

Closed
RangerMauve opened this issue May 2, 2016 · 9 comments
Closed

Use milliseconds instead of seconds #1

RangerMauve opened this issue May 2, 2016 · 9 comments

Comments

@RangerMauve
Copy link

This would be breaking and require a major version bump, but having millisecond-level control is useful for timing and it is the granularity that is supported by all the timing APIs (setTimeout, setInterval, etc..).

@rwu823
Copy link
Owner

rwu823 commented May 2, 2016

If you need milliseconds It just be passed stop(.1), that equal to 100ms, the seconds will keep the code shorter in most case.

@rwu823
Copy link
Owner

rwu823 commented May 2, 2016

And maybe in next:

stop.sec(3)
// or
stop.ms(300)

@RangerMauve
Copy link
Author

Fair enough

@eliperelman
Copy link

Still think the right answer is to use milliseconds instead of seconds. This keep the API consistent with standard methods. Not to mention, the bulk of timeouts in JS userland are probably under 1 second, which is the greater use case.

@RangerMauve RangerMauve reopened this May 12, 2016
@rwu823
Copy link
Owner

rwu823 commented May 12, 2016

@eliperelman

Yes, good point. it will be changed in next roadmap.

What do you think? if this way

stop.sec(3)
// or
stop.ms(300)

@lucianopf
Copy link

lucianopf commented May 13, 2016

Sorry to interrupt, but I guess that only stop(300) using milliseconds it is enough to contemplate the API following the default standards.

Adding auxiliary methods just to increase the readability will in fact increase the complexity of the solution, raising the learning curve.

It seems overreacting but if you consider the variety of methods in lodash you will realize how big the API would get if they decided to comtemplate things like that.

@rwu823
Copy link
Owner

rwu823 commented May 13, 2016

@lucianopf

hmm, it makes sense

@fregante
Copy link
Contributor

fregante commented May 16, 2016

sindresorhus/delay already supports milliseconds by default, is more flexible and it's smaller (no dependencies)

@rwu823
Copy link
Owner

rwu823 commented May 16, 2016

API already changes to milliseconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants