This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Multiple timer issues + new [PATCH]
- From: ikartur at gmail dot com
- To: cygwin-patches at cygwin dot com,john hood <cgull at glup dot org>
- Date: Fri, 19 Feb 2016 10:02:04 +0100
- Subject: Re: [PATCH] Multiple timer issues + new [PATCH]
- Authentication-results: sourceware.org; auth=none
- References: <CAJCedbifwNgza6nUfSX6QH8ovnEy85bRJ=vH8SGuA_hNYdW5bw at mail dot gmail dot com> <56C67173 dot 3030508 at glup dot org>
Hi,
On Feb 19, 2016 2:35 AM, "john hood" <cgull@glup.org> wrote:
> There's some information on the web discussing issues with
> QueryPerformanceCounter()
QueryPerformanceCounter() is the officially recommended method for time interval measurements:
https://blogs.msdn.microsoft.com/oldnewthing/20140822-01/?p=163/
https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx
Best Regards,
ArtÃr
-----Original Message-----
From: john hood <cgull@glup.org>
To: cygwin-patches@cygwin.com
Sent: Fri, 19 Feb 2016 2:35
Subject: Re: [PATCH] Multiple timer issues + new [PATCH]
On 2/18/16 6:39 PM, IrÃnyossy Knoblauch ArtÃr wrote:
> The ntod timer (type hires_ns), however, is getting its time value
> from QueryPerformanceCounter(), which, according to the MSDN
> documentation, will provide a "time stamp that can be used for
> time-interval measurements" -- that is just what the doctor ordered.
> :-)
I have some interest in this because my work on select() may interact
with what you're doing here.
There's some information on the web discussing issues with
QueryPerformanceCounter(), for example
<http://www.virtualdub.org/blog/pivot/entry.php?id=106>. This is mostly
an issue with CPUs available in the (I think) 2003-2006 time frame, such
as early AMD Athlons and early Intel Core iNNN and iNNNN CPUs. Earlier
CPUs didn't have both changeable clock rates and RDTSC, and later CPUs
had RDTSC but the clock rate is constant for RDTSC. It's also possible
that only some versions of Windows have issues in this area, maybe later
versions of Windows avoid this problem. Does your code work properly in
this case?
regards,
--jh