Skip to content

Add calculation for milliseconds in a day #320

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

Merged

Conversation

ychek
Copy link
Contributor

@ychek ychek commented Sep 6, 2020

Hey,

I think it's a bit more clear like that. WDYT?
Also there was a little typo because 86_400_000 is not a number.

@zachlysobey
Copy link

I like it a little better like this too.
A quick note though: that number is fine. Or at least, valid as a stage-4 TC39 proposal and available pretty widely.

https://tc39.es/proposal-numeric-separator/

@ychek
Copy link
Contributor Author

ychek commented Sep 7, 2020

You are right @zachlysobey!
That number is fine, and I was not aware of that numeric separator that are an amazing feature BTW. ;)
However we agree that calculation is important to better understand that number.

@ryanmcdermott
Copy link
Owner

Thanks! The only advantage to storing it as a flat constant is that you don't need to worry about re-running computations unnecessarily but as far as I understand V8 (as of this year) performs constant folding, and likely you could get the same benefit in TypeScript compiler optimization if they don't exist already.

@ryanmcdermott ryanmcdermott merged commit 8f678c8 into ryanmcdermott:master Oct 7, 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.

3 participants