Boost logo

Boost :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-05-16 02:59:51


Silex wrote:
> I did some tests with the current boost::posix_time::microsec_clock
> and it *looks* like GetSystemTimeAsFileTime() has low level
> resolution,

The resolution is good, but the time isn't updated any more often than the
system clock (usually some 10-15 milliseconds).

> BUT I read somewhere that it's overhead is huge compared
> to QueryPerformanceCounter.

I'd say it's usually the opposite way around, unless somethings changed due
to some later WinXP service pack or hot fix. QPC can be a real performance
killer on single CPU systems. It's been a while since I tested thought, so I
can't speak for certain for how the performance counter is implemented on HT
and/or dual-core platforms.

>
> I'll try to see if there's a way to get the epoch from
> QueryPerformanceCounter or timeGetTime, so I could make a usable
> microsec_clock based on it.

Are you really talking about getting an absolute time with
milli-/microsecond resolution? Be prepare to put down some work - there's no
supported way of getting a correlation between the monotonic counters and
calendar time.

// Johan


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