in reply to (tye)Re2: Converting Seconds to Nice Format
in thread Converting Seconds to Nice Format
%would be better used -- and I will admit I'm fuzzy on the actual under-the-hood implementation of this in Perl. I had it pegged as at least as fast as the multiplication and subtraction but it might be slower -- I just don't know. It fits my eye, end of story.
Regarding the 60*60*24*365 issue, I still think it's best to just explicitly code 60, 3600, etc (and perhaps include the product notation as a comment).
I will add that your example is creative and exploits the power of Perl, but at the same time some of the others are more transparent to casual perusers of the code. For enthusiasts I like yours, but if you're sharing with other maintainers a more "obvious" might be appropriate.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re3: Converting Seconds to Nice Format
by tye (Sage) on Nov 14, 2000 at 20:22 UTC |