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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cae92f92d6a1d4b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: BrianG Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Sun, 12 Dec 2010 16:59:16 -0500 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 12 Dec 2010 21:59:20 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="BssHc7ONlcOOcC5Vapr56Q"; logging-data="787"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fGO4dw4xMUvDuUAUfdgcL" User-Agent: Thunderbird 2.0.0.24 (X11/20100623) In-Reply-To: Cancel-Lock: sha1:Xwacz1jKsRJNzom5MufU/KtpKyA= Xref: g2news2.google.com comp.lang.ada:16878 Date: 2010-12-12T16:59:16-05:00 List-Id: Jeffrey Carter wrote: > On 12/11/2010 09:19 PM, BrianG wrote: >> ... > I think you're over complicating things. > > function To_Duration (Time : Ada.Execution_Time.CPU_Time) return > Duration is > Seconds : Ada.Real_Time.Seconds_Count; > Fraction : Ada.Real_Time.Time_Span; > begin -- To_Duration > Ada.Execution_Time.Split (Time, Seconds, Fraction); > > return Duration (Seconds) + Ada.Real_Time.To_Duration (Fraction); > end To_Duration; > That's what I get for evolving thru several iterations before coming up with a function. (BTW, where is To_Duration defined for integer types? The only one in the Index is for Time_Span.) But my question still remains: What's the intended use of Ada.Execution_Time? Is there an intended use where its content (CPU_Time, Seconds_Count and Time_Span, "+", "<", etc.) is useful? --BrianG