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: a07f3367d7,cae92f92d6a1d4b1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.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: Wed, 22 Dec 2010 15:09:33 -0500 Organization: A noiseless patient Spider Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 22 Dec 2010 20:09:32 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="P3VOJKrHjsVRylhXLW3J8w"; logging-data="8014"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aytWycZabpt3Q89gc1cX5" User-Agent: Thunderbird 2.0.0.24 (X11/20100623) In-Reply-To: Cancel-Lock: sha1:9NrSRNLLmumLxxZtlBSSC9dVKUs= Xref: g2news2.google.com comp.lang.ada:17080 Date: 2010-12-22T15:09:33-05:00 List-Id: anon@att.net wrote: > In , BrianG writes: >> anon@att.net wrote: >> I have no problem with what Execution_Time does (as evidenced by the >> fact that I asked a question about its use) - it measures exactly what I >> want, an estimate of the CPU time used by a task. My problem is with >> the way it is defined - it provides, by itself, no "value" of that that >> a using program can make use of to print or calculate (i.e. you also >> need Real_Time for that, which is silly - and I disagree that that is >> necessarily required in any case - my program didn't need it otherwise). >> --BrianG > There has been many third party versions of this package over the years > and most of them included a Linux version. The Windows is specific to GNAT. > And it just like GNAT the Windows version is not complete either. My comments have been about the RM-defined package and its lack of usability (if that wasn't already clear). What may or may not be provided by implementation-specific packages is irrelevant. > > For Execution_Time there are three package. GNAT has > Ada.Execution_Time for both Linux-MaRTE and Windows > Ada.Execution_Time.Timers only for Linux-MaRTE > Ada.Execution_Time.Group_Budgets Unimplemented Yet > When you say "GNAT" here you should probably specify what version you mean. I haven't looked in this area, but I was under the impression that GNAT has implemented all of Ada'05 for quite a while now (in Pro; maybe it has not yet all reached GCC or GPL releases?). > > > In using the Linux-MaRTE version ( 2 packages ) > Ada.Execution_Time > Ada.Execution_Time.Timers See below. > > Of course in this example you could use ( Note: they are fully implemented ) > Ada.Real_Time > Ada.Real_Time.Timing_Events So, instead of using a functionality already provided (with a slight kludgy issue), I should implement it entirely myself? I still don't see how this could get me CPU_Time (even a "simulation" value). > > > An algorithm comparison program might look like: > > with Ada.Execution_Time ; > with Ada.Execution_Time.Timers ; Given the below program, please add some of the missing details to show how this can be useful without also "with Ada.Real_Time". Neither Execution_Time or Execution_Time.Timers provides any value that can be used directly. > > procedure Compare_Algorithm is > > task type Algorithm_1 is > use Ada.Execution_Time.Timers ; > begin > begin > Set_Handler ( ... ) ; -- start timer > Algorithm_1 ; > Time_Remaining ( ... ) ; -- sample timer > end ; > Cancel_Handler ( ... ) ; release timer > end ; > > task type Algorithm_2 is > use Ada.Execution_Time.Timers ; > begin > begin > Set_Handler ( ... ) ; -- start timer > Algorithm_2 ; > Time_Remaining ( ... ) ; -- sample timer > end ; > Cancel_Handler ( ... ) ; release timer > end ; > > use Ada.Execution_Time ; > > begin > -- Start tasks > -- wait until all tasks finish > -- compare times using Execution_Time Provide details here (line above and line below)- without relying on CPU_Time or Time_Span, which are both private. > -- Print summary of comparison > end ; > > --BrianG