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,61d8daec8bfa486e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!takemy.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: An Example for Ada.Execution_Time 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: <1fb06tjt2dy1y$.1tkafcv9oya2w.dlg@40tude.net> <8o61e2FkdvU1@mid.individual.net> Date: Fri, 31 Dec 2010 15:15:07 +0100 Message-ID: <1jmysfv0ifrrj$.h84gfj1gv0ht.dlg@40tude.net> NNTP-Posting-Date: 31 Dec 2010 15:15:05 CET NNTP-Posting-Host: 3dc57332.newsspool4.arcor-online.net X-Trace: DXC=e@O`_mX_WmC2:OR3:3gaE@4IUKJP`>L7^2A X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:17257 Date: 2010-12-31T15:15:05+01:00 List-Id: On Fri, 31 Dec 2010 14:42:41 +0200, Niklas Holsti wrote: > Dmitry A. Kazakov wrote: >> On Thu, 30 Dec 2010 18:51:30 -0500, BrianG wrote: >> >>> Since D.16 defines CPU_Time as if it were a numeric value, is it too >>> much to ask why a conversion to some form of numeric value wasn't >>> provided? >> >> But time is not a number and was not defined as if it were. > > You keep saying that, Dmitri, but your only argument seems to be the > absence of some operators like addition for CPU_Time. Since CPU_Time is > private, we cannot tell if this absence means that the D.14 authors > considered the type non-numeric, or just considered the operators > unnecessary for the intended uses. No, the argument is that time is a state of some recurrent process, like the position of an Earth's meridian relatively to the Sun. This state is not numeric, it could be numeric though. That depends on the nature of the process. >> It is the time >> differences which are numeric. RM D.14 defines differences of CPU_Time as >> Time_Span. Time_Span is numeric. > > CPU_Time is logically numeric, since its "values correspond one-to-one > with a .. range of mathematical integers" by RM D.14 (12/2). Moreover, > RM D.14 (13/2) uses the symbol "I" to stand for a value of CPU_Time, and > then uses "I" as a factor that multiplies a floating-point number. So > "I" clearly stands for a number (one of the "mathematical integers"). No, this stands only for countability. Time is not a number, it can be represented in the form Epoch + n * Interval, where n is a number. > - by RM D.14 (13/2), "the execution time value is set to zero at the > creation of the task". I agree that here RM is sloppy. They should rather talk about an "epoch" rather than "zero," if they introduced CPU_Time as a time. >> Ada.Execution_Time.Clock - CPU_Time_First > > No. There is no rule in D.14 that makes CPU_Time_First equal to the > CPU_Time at the start of a task (which by D.14 (13/2) is "zero"). OK, I agree with that. Correction: Ada.Execution_Time.Clock - Ada.Execution_Time.Time_Of (0) > As far as I can tell, the only sure way to get the task's execution time > as a Time_Span or Duration is to read and store the value of > Ada.Execution_Time.Clock at the start of the task, and then use that in > Dmitry's subtraction formula instead of CPU_Time_First. I suppose Time_Of (0) is the time when the task started because of D.14 (13/2). Happy New Year, -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de