Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2002-04-13 18:54:36


> It seems to me that the present implementation of xtime on many platforms
> relies upon the system's current time - this could change at any point! The
> system time may be set backwards by the user or forwards by daylight saving'
> s time, both which may result in code using xtime to receive incorrect time
> durations.
>
> Consider the following...
>
> boost::xtime xt;
> boost::xtime_get(&xt, boost::TIME_UTC);

The TIME_UTC is not subject to DST. Although it still depends on the timezone settings of the
computer staying constant between calls. This is usually a reasonable assumption.

> Would it not make more sense to always base durations in time upon something
> which is always moving forward in time at a consistent rate, such as the
> system uptime?

Possibly for the case of thread management this would make sense. The question is how to make it
portable. The current xtime implementation relies on the C API for portability...

Jeff


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