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=ham 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 Date: Sun, 09 Dec 2007 13:50:08 +0100 From: Gautier User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT.Sockets: Timeval_Duration is in milliseconds? References: <99906a58-2645-4880-bd13-9b63a30ffb59@e4g2000hsg.googlegroups.com> <11adowbxp1rax$.13d1jgzb1wtsn.dlg@40tude.net> In-Reply-To: <11adowbxp1rax$.13d1jgzb1wtsn.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.76.148.131 X-Original-NNTP-Posting-Host: 83.76.148.131 Message-ID: <475be475$1_1@news.bluewin.ch> X-Trace: news.bluewin.ch 1197204597 83.76.148.131 (9 Dec 2007 13:49:57 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news1.google.com!news1.google.com!news.glorb.com!wn14feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news1.google.com comp.lang.ada:18808 Date: 2007-12-09T13:50:08+01:00 List-Id: 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. > 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. I guess it's why it is not a floating type, but a fixed one. 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! ______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!