Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2006-05-15 12:03:12

Silex wrote:
> I found out that there's already
> <boost/date_time/microsec_time_clock.hpp>, but on windows it uses
> GetSystemTimeAsFileTime().
> 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
> true.

Clocks are highly variable depending on the hardware, OS, etc. QPC
clocks have been discussed before, but honestly I think you'll get 90%
of the what you can get with the current date-time clock.

> 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 ?

Sure -- I've uploaded some prototype code to that vault under
date_time/ that I worked on at some point in the past. It
should get you going. Please evolve it and send me issues.


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