|
Boost : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2006-10-31 20:03:28
Philippe Vaucher wrote:
>> I haven't tried it but according to various links, GetSystemTime() only
>> gives
>> ~10ms or ~15ms precision
>
>
> Thank you for the links!
>
> Some results looks bizarre tho, like timeGetTime() at the same level than
> GetTickCount() seems quite weird to me.
> The graphs also seems to indicate QPC has one of the largest call overhead,
> would it be a concern ?
>
> Anyway, this makes me wonder what is the rational behind using
> GetSystemTimeAsFileTime() to implement date_time::microsec_clock ? Does
> anyone know (or could an author entlighten us) ?
Sorry to be so quiet...it's not that I'm not interested, just too busy to
really contribute. Anyway, the reason for GetSystemTimeAsFileTime is that it
works. And it doesn't suffer from the rollover issue and the stability issues
that the QPC stuff does in the face of multi-threading. So it just works and
it gives enough precision for 90% of the applications.
> This also raise another question, if we chose to implement microsec_timer
> with QPC, what will we name the timer implemented with
> posix_time::microsec_clock (which is just a typedef for
> date_time::microsec_clock) ?
I'll be happy to replace the current microsec_clock implementation as long as
you can deal with rollover and multi-threading. Oh, and you can't add any
data members to the ptime which might expand it's size. And since the
microsec_clock is all static there could be some complications if you need to
store data to handle rollover. QPC based implementation been discussed for
years, but I've never seen anyone actually implement something that works as
reliably as GetSystemTimeAsFileTime....
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk