Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][chrono] time_since_epoch different on windows and linux
From: Ralf Globisch (RGlobisch_at_[hidden])
Date: 2011-12-08 23:50:08


>>> On 08/12/2011 at 23:57, in message
<CAOU91OOrXc_BkOcFt1fK=e+oC5VkC-_5CJmT7iGj_CJ34zZPZQ_at_[hidden]>,
Klaim -
Joël Lamotte<mjklaim_at_[hidden]> wrote:
> Hi,
>
> The documentation makes clear that epoch is implementation dependent
:
>
> "The library leaves epochs unspecified."
>
>>From : http://www.boost.org/doc/libs/1_48_0/doc/html/chrono.html
>
> "In each of the examples above, a different epoch is implied.
Sometimes
> an epoch has meaning for several millennia. Other times the meaning
of an
> epoch is lost after a while (such as the start of a timer, or when
the
> computer booted). However, if two
>
time_point<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/reference.htm

> l#chrono.reference.cpp0x.time_point_hpp.time_point>s
> are known to share the same epoch, they can be subtracted, yielding a
valid
>
duration<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/reference.html#

> chrono.reference.cpp0x.duration_hpp.duration>,
> even if the definition of the epoch no longer has meaning.
>
> In *Boost.Chrono*, an epoch is a purely abstract and unspecified
concept.
> There is no type representing an epoch. It is simply an idea that
relates
> (or doesn't)
>
time_point<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/reference.htm

> l#chrono.reference.cpp0x.time_point_hpp.time_point>s
> to a clock, and in the case that they share a clock,
>
time_point<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/reference.htm

> l#chrono.reference.cpp0x.time_point_hpp.time_point>s
> to one another.
>
time_point<http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/reference.htm

> l#chrono.reference.cpp0x.time_point_hpp.time_point>s
> associated with different clocks are generally not interoperable
unless the
> relationship between the epochs associated with each clock is
known."
>
>
>>From
http://www.boost.org/doc/libs/1_48_0/doc/html/chrono/users_guide.html

>
> My understanding is that chrono isn't meant to provide absolute time
> "position", but time measurement and manipulations.
> The difference being that epoch is an arbitrary referential used to
allow
> now() to be written and worked with.
>
> Joël Lamotte

Thanks a lot for the clarification Joël, I had read the quoted section,

but interpreted it incorrectly.

Regards,
Ralf

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net