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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: comp.lang.ada Subject: Re: how to analyze clock drift Date: Wed, 19 Nov 2014 23:12:41 +0100 Organization: Aioe.org NNTP Server Message-ID: <87k32qet5y.fsf@debian.uxu> References: <6uun6alsp3jh1pob6g9qgcg85etqgenmd0@4ax.com> <87zjbn3nss.fsf@debian.uxu> <1nvfhit2csxr5.41v36jksch28$.dlg@40tude.net> NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:+V1Ii7gYSmzEbC88PQ/s82zIwg0= Mail-Copies-To: never Xref: news.eternal-september.org comp.lang.ada:23557 Date: 2014-11-19T23:12:41+01:00 List-Id: "Dmitry A. Kazakov" writes: > You certainly can use OS services from C++, instead > of them. What I use is the stuff, e.g.: std::chrono::system_clock::now() std::this_thread::sleep_until(re_sched_time) > You need a reference clock [big cut] Thank you for that post, it is a bit too advanced to me, so I'll print it and read it again and probably be back with some questions. I got a mail from my teacher - it sounds like a lot of what you said (?): You could [...] calculate with the offsets from the desired values [...] o0 = t1 - t0 - DESIRED_TICK o1 = t2 - t1 - DESIRED_TICK o2 = t3 - t2 - DESIRED_TICK ... where DESIRED_TICK is the tick lengths you were aiming for. [...] From these points you can easily calculate the average, minimum and maximum values and their standard deviation. The average will be a measure of the drift, the min/max the worst-case (observed) behaviors and the standard deviation a measure of the stability. > Also, you mention the short trace. How long a > trace is needed (like a rule-of-thumb) to cover > all or most patterns? It's difficult to say. As a rule-of-thumb I suppose one can say that when the values you are calculating don't change significantly with longer traces, the trace is long enough. But by the nature of the problem you can never know, for example, if a larger maximum value would be seen if the trace was just a little longer. -- underground experts united