[Issue 13433] Request: Clock.currTime option to use CLOCK_REALTIME_COARSE / CLOCK_REALTIME_FAST

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Oct 3 23:13:27 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13433

--- Comment #5 from Jonathan M Davis <jmdavisProg at gmx.com> ---
Hmmmm. The precision of the _COARSE variants is abysmal. Apparently, it's only
1 ms (at least on Linux). So, I certainly think that it would be foolish to use
them normally, but I see no problem with adding a defaulted parameter which
would use them underneath the hood, and then anyone who wants to make the
tradeoff for the worse precision can. I'll make a pull request for it.

However, I think that the only systems that this will affect are Linux and
FreeBSD. Mac OS X currently uses gettimeofday (which I'm not enthused about,
but I don't know of a better option there), and AFAIK Windows doesn't have
anything like the COARSE option, and I don't know how fast
GetSystemTimeAsFileTime is in comparison to the options on the POSIX systems.
So, the new parameter will effectively be ignored on some systems.

--


More information about the Digitalmars-d-bugs mailing list