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,8ee4430d1820a774 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: GNAT.Sockets: Timeval_Duration is in milliseconds? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.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: <99906a58-2645-4880-bd13-9b63a30ffb59@e4g2000hsg.googlegroups.com> <11adowbxp1rax$.13d1jgzb1wtsn.dlg@40tude.net> <475be475$1_1@news.bluewin.ch> Date: Sun, 9 Dec 2007 14:37:16 +0100 Message-ID: <19amcnh3o4zrw$.u4t8yqa5xhl5.dlg@40tude.net> NNTP-Posting-Date: 09 Dec 2007 14:37:18 CET NNTP-Posting-Host: 2f395e2f.newsspool2.arcor-online.net X-Trace: DXC=9bYLbCC6PjT[7Non7UCi8UA9EHlD;3YcR4Fo<]lROoRQ4nDHegD_]RUP8abb`:5fMPDNcfSJ;bb[UIRnRBaCd On Sun, 09 Dec 2007 13:50:08 +0100, Gautier wrote: > Dmitry A. Kazakov wrote: >> On Sat, 08 Dec 2007 19:45:53 -0600, tmoran@acm.org wrote: >> >>> The Ada 95 LRM 9.6(7) says >>> "...; a value of type Duration is used to represent the length of >>> an interval of time, expressed in seconds." >>> >>> It would be bad practice to use a value of type Duration to represent, >>> say, the number of gallons of gasoline remaining, and it would be even >>> worse, because even more confusing, to use it to represent a number >>> of milliseconds. >> >> Sorry but this makes no sense. The physical entity being measured is >> duration T. Gallon is a measure of volume L**3. Clearly T /= L**3. > > I think it Tom's point: it is so absurd that it is less likely to be mixed. But seconds and millisecond can be freely mixed. 1ms + 1s = 1.001s = 1001ms. >> As for seconds, milliseconds, years, centuries etc, all they fall under the >> category T (duration). They are numbers expressing the *same* physical >> entity. > > Not exactly: the unit for Duration is a second, not a millisecond. The point is that the thing measured is duration, not seconds or milliseconds. > I guess it's why it is not a floating type, but a fixed one. ? I never heard that duration were a subject of quantization. In any case it would be far smaller than 1ms. The choice of numerical model is IMO an implementation issue. > The SI unit for time is the > second, not the millisecond; for weight it is the kilogram, not the gram. If > parts of your program think that a second is worth 1000.0 with type Duration and > others think that it is 1.0, you are in trouble - imagine a delay statement that > controls the opening of a door in a space station! HAL, please! Exactly my point, this is why one should use Ada's type Duration. There cannot be any reason to introduce another duration type other than on implementation grounds. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de