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: a07f3367d7,36a9f38dd6514fc8 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: gnat: Execution_Time is not supported in this configuration 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: <5e5d6fb5-e719-4195-925c-d1286699393d@f16g2000yqm.googlegroups.com> Date: Fri, 4 Dec 2009 12:26:26 +0100 Message-ID: <1fhe7xz86ka87$.13so8n7lqqhec$.dlg@40tude.net> NNTP-Posting-Date: 04 Dec 2009 12:26:27 CET NNTP-Posting-Host: 192ac26c.newsspool4.arcor-online.net X-Trace: DXC=DQCmdl34CUm>jlK2>IgHGd4IUKo4]@`?Ej06Fi X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8306 X-Original-Bytes: 3612 Date: 2009-12-04T12:26:27+01:00 List-Id: On Fri, 4 Dec 2009 03:09:35 -0800 (PST), singo wrote: > I have recently become very interested of Ada 2005, and it's real-time > annex. However, as a new user of Ada I face some problems with the > software. > > I cannot get the package Ada.Execution_Time to work with gnat, > although the gnat documentation says that the real-time annex is fully > supported... I use the gnat version 4.4 on a Ubuntu 9.10 distribution. > > The typical error message I get is > > gcc -c executiontime.adb > Execution_Time is not supported in this configuration > compilation abandoned > > How can I configure gnat to support the Ada.Execution_Time package? > > Hopefully somebody can help me! > > Thanks in advance! > > Ingo > > Below follows an example program that generates the error messge. > > with Ada.Text_IO; use Ada.Text_IO; > with Ada.Real_Time; use Ada.Real_Time; > with Ada.Execution_Time; > > procedure ExecutionTime is > task T; > > task body T is > Start : CPU_Time; > Interval : Time_Span := Milliseconds(100); > begin > Start := Ada.Execution_Time.Clock; > loop > Put_Line(Duration'Image(Ada.Execution_Time.Clock - Start)); > delay To_Duration(Interval); > end loop; > end T; > begin > null; > end ExecutionTime; I cannot tell anything about Ubuntu, but the program you provided contains language errors. It also has the problem that "delay" is non busy in Ada, i.e. the program will count 0 CPU time for a very long time, at least under Windows, where the system services, which I presume, Ada.Execution_Time relies on, are broken. Anyway, here is the code which works to me: with Ada.Text_IO; use Ada.Text_IO; with Ada.Real_Time; use Ada.Real_Time; with Ada.Execution_Time; use Ada.Execution_Time; procedure ExecutionTime is task T; task body T is Start : CPU_Time := Clock; begin loop Put_Line (Duration'Image (To_Duration (Clock - Start))); for I in 1..40 loop Put ("."); -- This does something! end loop; end loop; end T; begin null; end ExecutionTime; Under Windows this shows rather poor performance, which again is not surprising, because as I said there is no way to implement Ada.Execution_Time under Windows. Maybe Linux counts CPU time better, I never investigated this issue. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de