[phobos] std.datetime and tick types
Jonathan M Davis
jmdavisProg at gmx.com
Mon Sep 27 08:51:00 PDT 2010
On Monday 27 September 2010 07:52:48 Robert Jacques wrote:
> On Mon, 27 Sep 2010 09:52:17 -0400, SHOO <zan77137 at nifty.com> wrote:
> > (2010/09/27 20:22), Jonathan M Davis wrote:
> >> /++
> >>
> >> Represents possible units of time.
> >>
> >> +/
> >>
> >> enum TUnit { year, month, week, day, hour, minute, second, millisecond,
> >> microsecond, stdTick }
>
> [snip]
>
> >> What I'd really like is to find a better name than tick or std tick for
> >> my ticks.
> >> What would that be anyway? A deci-microsecond? A centa-nanosecond?
> >> Either name
> >> would be horrible.
>
> A hundred nanoseconds would be a deci-microsecond or a hecto-nanosecond.
> Both are used, though hectonanosecond seems to be more popular, both
> generally and with programmers. For example, Apple's Network Time Protocol
> codebase uses the unit. I don't find either name horrible and would prefer
> an actual unit of time in TUnit as opposed to a made up name which I'd
> have to remember is actually a hectonanosecond. Perhaps this is my
> scientific background coming through.
Well, aside from the fact that I think that most people have never heard of a
hectonanosecond, it's awfully long to type. millisecond and microsecond are bad
enough. And do you really want to have to use functions like
totalHectonanoseconds()? Perhaps with a good abbrevation... hnsec? I'll have to
think about it. As words go, ticks is far more pleasant, but it isn't as
precise.
- Jonathan M Davis
More information about the phobos
mailing list