Boost logo

Boost :

From: Silex (silex0r_at_[hidden])
Date: 2006-05-15 11:46:00

I found out that there's already
<boost/date_time/microsec_time_clock.hpp>, but on windows it uses

This raises a potential issue: I don't know if
GetSystemTimeAsFileTime() works at millisecond resolution like
QueryPerformanceCounter() does, and I don't know if
QueryPerformanceCounter() returns some kind of epoch.. the docs are
rather lowly-documented on this.

I also noticed that getimeofday() wasn't checked for failure in the
current boost headers.

I also fell on a page which stated that "On Windows, clock() returns
the nearest approximation to wall-clock time since the first call to
this function, based on the Win32 function QueryPerformanceCounter().
The resolution is typically better than one microsecond.". While I
doubt it it might be interesting for our problem if it happen to be

After the suggestions & having read the wiki I think we should indeed
modifiy parts of date_time and template the timer class like
mentionned. Should I try to give it a go ?


On 5/15/06, Jeff Garland <jeff_at_[hidden]> wrote:
> Carlo Wood wrote:
> > On Sun, May 14, 2006 at 05:09:28PM +0200, Silex wrote:
> >> Would boost be interested by including this class in boost::timer ?
> >
> > Even more so when it had microsecond precision.
> >
> >> I'm all ear for your suggestions / bugs / whatever fits it :)
> >
> > It would be better when the object itself can be handled as variable
> > (independent of it's internal structure).
> >
> > For that to work best, there shouldn't be any 'double's in the
> > internal structure. Two int's, one for seconds and one for microseconds,
> > would be best, imho. There could be an accessor to get a rounded
> > double in seconds, ie 'rseconds()' (I'd reserve 'seconds()' for
> > returning the integer number of seconds.
> I agree with this and it's been discussed before. Note I haven't looked
> at the new proposals, and can't till later, but I would like everyone
> interested in this topic to please look at:
> This is a proposal for the current timer to be replaced with a core
> template that can use date_time types (including the microsecond clock
> type) and time durations. Please edit and update this page with
> additional thoughts.
> Thx,
> Jeff
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at