From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed1.swip.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: how to analyze clock drift Date: Mon, 24 Nov 2014 09:44:39 +0100 Organization: cbb software GmbH Message-ID: References: <87zjbn3nss.fsf@debian.uxu> <1nvfhit2csxr5.41v36jksch28$.dlg@40tude.net> <87k32qet5y.fsf@debian.uxu> <188uppnlnvqgq$.1kjz3jnhjxqji.dlg@40tude.net> <87fvdd38qi.fsf@debian.uxu> <87a93l35dm.fsf@debian.uxu> <9t7t6al8bmifd9krh6koiegttgsvcovadg@4ax.com> <87d28h1cj9.fsf@debian.uxu> <3apu6ap126abi6oalch9vpre20hjij2uon@4ax.com> <87k32oi7r8.fsf@debian.uxu> <98h17atrhtl9kitthjf8ukt1f7rk1ribvc@4ax.com> <8761e54qt2.fsf@debian.uxu> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: nyHeW7QjJmC1odUjK4LkDA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:190993 Date: 2014-11-24T09:44:39+01:00 List-Id: On Sun, 23 Nov 2014 20:15:36 -0500, Dennis Lee Bieber wrote: [...] > One thing not seen in the above, is that under Windows, there are > uncontrollable events that will throw a data point out to the extreme... > Look at the millisecond data (0.001). The max latency was 5.1E-4, while the > mean was 2.9E-6. In a run of 500 samples, only 2 or 3 data points jumped to > that high value. That's a sign of the OS doing some house-keeping and > blocking the program from responding. But to see it requires plotting the > data -- once seen, one can attempt to explain that data point. Excluding > those data points will bring the mean down a small amount, but will reduce > the standard deviation significantly. A few notes: 1. It is impossible under Windows (Win32) to wait (non-busily) for a time period shorter than 1ms. This is the highest possible resolution (but not accuracy) of all waitable services. Furthermore, depending on the Windows version, you should probably change the minimum timer resolution. The function for this is timeBeginPeriod from winmm.dll. http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624%28v=vs.85%29.aspx I don't remember of Win32Ada include it, but it is no problem to call it without bindings. 2. If there is an assumption that some other processes intervene, you could change the priority of the task. E.g. http://msdn.microsoft.com/en-us/library/windows/desktop/ms686277%28v=vs.85%29.aspx Setting THREAD_PRIORITY_TIME_CRITICAL blocks practically everything (except for drivers). However I doubt that background processes or services are the problem when waiting for 10 or 5ms The rule of thumb for Windows is that anything below 5ms is unreliable. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de