comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Timing Block of GNAT code in milliseconds
Date: Sun, 24 Apr 2005 22:05:28 +0200
Date: 2005-04-24T22:05:19+02:00	[thread overview]
Message-ID: <ei2meksw8if6.11hcrgpc1osq5$.dlg@40tude.net> (raw)
In-Reply-To: x7vfyxgknor.fsf@smaug.pushface.org

On 24 Apr 2005 19:57:24 +0100, Simon Wright wrote:

> "Steve" <nospam_steved94@comcast.net> writes:
> 
>> "Simon Wright" <simon@pushface.org> wrote in message 
>> news:x7vsm1i2gs7.fsf@smaug.pushface.org...
>>> "Steve" <nospam_steved94@comcast.net> 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



  reply	other threads:[~2005-04-24 20:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 13:28 Timing Block of GNAT code in milliseconds markp
2005-04-21 18:00 ` tmoran
2005-04-21 18:53   ` markp
2005-04-21 19:40     ` Marc A. Criley
2005-04-21 19:44     ` Simon Wright
2005-04-22  1:00   ` Steve
2005-04-23  5:39     ` Simon Wright
2005-04-23 17:49       ` Steve
2005-04-24 18:57         ` Simon Wright
2005-04-24 20:05           ` Dmitry A. Kazakov [this message]
2005-04-25 22:56             ` Randy Brukardt
2005-04-28 20:26             ` Simon Wright
2005-04-29  8:11               ` Dmitry A. Kazakov
2005-04-29 18:25                 ` tmoran
2005-04-29 19:19                   ` Dmitry A. Kazakov
2005-04-29 20:24                     ` tmoran
2005-04-30  9:47                       ` Dmitry A. Kazakov
2005-04-29 20:52                 ` Randy Brukardt
2005-04-30 10:02                   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox