D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6724 - core.time.dur should use SI symbols for durations, not the ad hoc contractions it uses now
Summary: core.time.dur should use SI symbols for durations, not the ad hoc contraction...
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: Other Linux
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-24 14:11 UTC by siegelords_abode
Modified: 2016-10-15 01:01 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description siegelords_abode 2011-09-24 14:11:17 UTC
That is:
ms,ns,s,h,d,µs (I'd accept us as an alternative)

If not, at the very least use 'secs' and not 'seconds' so it matches the sub-second interval names.
Comment 1 Jonathan M Davis 2011-09-24 14:42:11 UTC
All units seconds and greater are spelled out completely. All sub-second units are abbreviated. That's by design.

We _could_ make it so that there are multiple names for each unit type, but then that gets messy - both in terms of code and in terms of people having to decipher template constraints. It's just cleaner to accept one specific string for each unit type. So, I think that having multiple is ultimately a bad idea.

Changing the unit strings would break code for little gain IMHO. And going for names as short as you suggest is error-prone. It's already bad enough that msecs, usecs, and hnsecs are as similar as they are. The functions that the unit strings are used with are exactly the kind of functions where it's often easy to not notice a bug when the units are slightly off. So, making them even less distinct would _not_ be a good idea as far as I'm concerned.