Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2003-09-04 07:15:44


On Wed, 03 Sep 2003 15:07:59 -0400, David Abrahams wrote
> "Jeff Garland" <jeff_at_[hidden]> writes:
>
> > On Tue, 02 Sep 2003 19:00:42 -0400, David Abrahams wrote
> >> The "fractional seconds" concept is undocumented. My guess it's
> >> something like:
> >>
> >> x.fractional_seconds() == x.ticks() % seconds(1).ticks()
> >>
>
> Uh-huh. So is my formula above correct or not?

Sorry, yes I believe so.

> > To really use fractional_seconds you call the resolution traits by
> > calling:
> >
> > time_duration::rep_type::res_adjust()
>
> Where is *that* documented?

It isn't, that's the problem.
 
> ...code deleted...
> I'm sorry, that's really nasty. Why wouldn't I just do
>
> seconds(1).ticks()
>
> ??

Never thought of it, nice trick :-)

> OK, well I do. I'm porting some Java code which uses times in whole
> milliseconds, and when a time gets written to disk I need to write
> the number of milliseconds to maintain a compatible format.

Ok. And I assume that you want to use it as a duration within
the program? Makes sense.
 
> > But now that I think about it would seems like it might
> > be possible to provide the inverse interface...
>
> Yeah, easy even.

Care to share what you are thinking?

> >> BTW, why plural hours, minutes, seconds, but singular millisec,
> >> microsec, nanosec?
> >
> > Yikes! They probably all should be plural. Problem is the abbreviated
> > 'millisecs' doesn't sound right to me, so perhaps that's the reason....
>
> Well, abbrevs just don't sound right. Bite the bullet and use the
> full names, please!

I've added full length names to CVS (milliseconds, nanoseconds, microseconds).
   I'll deprecate the old names over a release or so.

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk