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,FREEMAIL_FROM, 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!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news2.dg.net.ua!news.ett.com.ua!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: An Example for Ada.Execution_Time Date: Tue, 28 Dec 2010 13:43:57 +0000 (UTC) Organization: ETT newsserver Message-ID: References: Reply-To: anon@anon.org NNTP-Posting-Host: dialup-4.225.173.124.dial1.dallas1.level3.net X-Complaints-To: usenet@news.ett.com.ua X-Notice: Filtered by postfilter v. 0.6.1 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:17159 Date: 2010-12-28T13:43:57+00:00 List-Id: In , BrianG writes: >anon@att.net wrote: >> You ask for an example. >I'll assume I am the "you". (Since you don't specify and didn't relate >it to the original thread.) > >I asked for: > >> 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 > >...] > >You provided: >> >> Here is an example for packages (Tested using MaRTE): >.... >> with Ada.Execution_Time ; >> with Ada.Real_Time ; >.... >> with Ada.Execution_Time ; >> with Ada.Execution_Time.Timers ; >> with Ada.Real_Time ; >.... > >As the extracts show, you could not do what I asked for. You said in >the original post you could do it with only the 2 Execution_Time >'with's. My entire point in this thread is that Execution_Time, as >defined, is useless by itself. > >--BrianG I changed the title so there was no need for reference lines Since 2006, a number of people have ask about Ada.Execution_Time package and no one has given a true example that uses that package for what it was created for. Until now! I gave you a simple example that can be easily modified to a more complex program. Problem: may be whats the maximum number of timers that can be allocated. and for your info (changes in work.adb) Task_0 : Work_Task ; Task_1 : Work_Task ; Task_2 : Work_Task ; Task_3 : Work_Task ; begin Initialize ( Work_Algorithm'Access ) ; Task_0.Start ( False ) ; Task_1.Start ( False ) ; Task_2.Start ( True ) ; -- just for a change Task_3.Start ( True ) ; ... will gives four tasks with four different timers. 2 timers that have the same interval 2 timers that changes the interval All that is needed is protect the Counter variable for each task and change the Counter print routine. And I will let others do that modification.