Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2002-02-24 21:58:45


> >>struct time_type
> >>{
> >> time_type(time_t secs = 0, long nsecs = 0) :
> >> m_secs(secs), m_nsecs(nsecs)
> >> { }
> >> time_t seconds() const { return m_secs; }
> >> long nanoseconds() const { return m_nsecs; }
> >> operator time_t () const { return m_secs; }
> >>private:
> >> time_t m_secs;
> >> long m_nsecs;
> >>};
> >
> >why should nanoseconds be supported? i just don't have an opinion
> >on this.
>
> Seems like we should hold off on time until Jeff Garland and his group get
> their time library proposal done.

This hasn't been fully settled, but the generic time has the ability to extract
the date, and the time of day (hours, minutes, seconds and fractions of a
second). The resolution of the fraction of seconds is something that can be
adjusted so if we need nanoseconds and the system can provide them then that's
we'll do. The fractions of a second approach allows most code to handle the
sub-second stuff generically for different resolutions. However, nanosecond
resolution won't be supported on many platforms, so we would need to play some
tricks (like set nanoseconds to zero on all non-supporting platforms or use a
templated time type to adjust the resolution by platform) to deal with this.

Jeff


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