question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support milliseconds, microseconds etc.

See original GitHub issue

If 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

1reaction
bersbersberscommented, Jul 16, 2020

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

humanize.naturaltime(2*365*24*60*60 - 1)

is 1 year, 11 months ago and not 2 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 of

humanize.naturaldelta(2*365*24*60*60 - 1)

is 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 expect 102 milliseconds.

1reaction
bersbersberscommented, Feb 12, 2020

Looks good to me, I’d use that 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found