lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Using std::chrono::high_resolution_clock for Timer implementat


From: Vadim Zeitlin
Subject: Re: [lmi] Using std::chrono::high_resolution_clock for Timer implementation
Date: Wed, 18 Aug 2021 18:15:25 +0200

On Fri, 4 Jun 2021 14:34:46 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> On 6/4/21 12:43 PM, Vadim Zeitlin wrote:
GC> [...big snip...] 
GC> >  So, to summarize, I'll confirm that we can rely on getting sufficient
GC> > precision from high_resolution_clock on all platforms we're interested in
GC> > and, if this is indeed the case, will just do the minimal changes to Timer
GC> > class implementation for now
GC> 
GC> Excellent.

 Unfortunately after running the tests the sad conclusion is that MinGW
does _not_ provide sufficient precision neither for high_resolution_clock
(which is the same as system_clock in this implementation) nor for
steady_clock: even though it claims to use nanosecond resolution, the
actual resolution is limited to milliseconds which is, of course,
unacceptably bad.

 And while it's possible to implement our own chrono::clock using
MSW QueryPerfomanceCounter() directly, as shown by this implementation
by Howard Hinnant at https://stackoverflow.com/a/15755865/15275, this
probably doesn't make much sense for lmi, which already has its own wrapper
around this MSW function, so we're going to have to postpone any changes
here until MinGW provides a decent implementation of the time-related
functions.

 Although I admit I'm not too optimistic about it happening any time soon,
knowing that the problem is known since at least ~8 years and nothing much
seems to have happened since then...

 Sorry for wasting your time, I should have started by checking this,
VZ

Attachment: pgpiBOSViI7m7.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]