Support milliseconds, microseconds etc.
See original GitHub issueIf you run something for a minute, humanize
is great. If you want to tell the user what you did in that time (100.000 things), and then want to brag about how fast that is (a moment
per thing?), humanize
is not super-great any more 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
Orders of magnitude (time) - Simple Wikipedia
Millisecond is one thousandth of a second. Centisecond is one hundredth of a second. Decisecond is one tenth of a second. Decasecond is...
Read more >Milliseconds and microseconds to seconds second
Notice: 1 second (s) = 1,000 milliseconds (10 3 ms) and 1 millisecond (ms) = 0.001 second (s) 1 millisecond (ms) = 1000...
Read more >What is the difference between nanoseconds, microseconds ...
A millisecond is 1x10^-3 second, which equals 1,000 microseconds and 1,000,000 nanoseconds. It is 1/1000 of a second. They are using engineering notation...
Read more >Millisecond, Microsecond, Nanosecond: What Can We Do ...
One electrical degree at 60 hertz is about 46 microseconds, so measurements accurate to ten microseconds give us accurate synchrophasors.
Read more >Why doesn't MySQL support millisecond / microsecond ...
"MySQL now supports fractional seconds for TIME, DATETIME, ... This is okay if microsecond precision isn't needed for date_diff etc.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, the test cases look good so far. The one I posted above is the first odd one I encountered in a while, but I’ll keep my eyes open for new ones.
One oddity to me (probably a side issue that might be further discussed elsewhere) is the rounding. While I can understand that
is
1 year, 11 months ago
and not2 years ago
, because the year is not complete yet and we don’t celebrate birthdays early (“how long ago was it?” - “2 years?” - “not yet!”), my intuitive expectation ofis actually
2 years
- because with deltas (“how long did it take?”), I feel rounding is much more natural.So for
101_943 / 1_000_000
, I’d probably expect102 milliseconds
.Looks good to me, I’d use that 😃