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 X-Google-Thread: 103376,d1f23f0bd3971bec X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Timing Block of GNAT code in milliseconds Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1114090119.383842.20950@l41g2000cwc.googlegroups.com> <1KydnfadqcK30fXfRVn-qw@comcast.com> Date: Sun, 24 Apr 2005 22:05:28 +0200 Message-ID: NNTP-Posting-Date: 24 Apr 2005 22:05:19 MEST NNTP-Posting-Host: bf120663.newsread2.arcor-online.net X-Trace: DXC=;3^SDYk=5ohIeeCiY5g2VcQ5U85hF6f;djW\KbG]kaMh:cmYYm_h3\cZF`nMKV:7I`WRXZ37ga[7jeh9Z=IkP^1dHE3jFgLcL_b X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:10672 Date: 2005-04-24T22:05:19+02:00 List-Id: On 24 Apr 2005 19:57:24 +0100, Simon Wright wrote: > "Steve" writes: > >> "Simon Wright" wrote in message >> news:x7vsm1i2gs7.fsf@smaug.pushface.org... >>> "Steve" writes: >>> >>>> I tend to think of the Real_Time package as the one to use when >>>> you are timing events and the Calendar package as the one to use >>>> when you don't care about precise timing and want the time of day >>>> for reporting, etc. >>> >>> It used to be the case with GNAT that there was an amazing >>> similarity between these two clocks! Looking on 5.02a1, on a first >>> glance it seems that Real_Time is derived as follows (the first >>> two letters are the encoding in the distribution, eg if building >>> on NT the file s-taprop.adb is copied from 5wtaprop.adb). >>> >> [snip] >> >> It would also be interesting to know whether there is a difference >> in the time base for Ada.Calendar and Ada.Real_Time for the >> different systems. > > There are two things, the tick rate and the epoch. All the ones that > use the system clock or gettimeofday or clock_gettime are going to > have identical Calendar and Real_Time (and, incidentally, fail to meet > the ARM requirement in D.8(32), "There shall be no backward clock > jumps.", if the system's time-of-day changes; the only one that > obviously meets that is VxWorks/Cert). Yes, but that shouldn't prevent them from using the same source. They could run synchronized, experiencing rare and short periods when Calendar jumps here and there. > I don't know about Windows NT. I presume Real_Time uses Windows' performance counter which never jumps. But I have no idea how Calendar behaves, especially in presence of some external time synchronization software like NTP. Alas, both clock models are quite useless in a distributed environment. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de