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=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,325a055bed62c230 X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: Apex vs GNAT on solaris Date: 1999/12/07 Message-ID: #1/1 X-Deja-AN: 557678042 References: <82hiuj$74o$1@nnrp1.deja.com> <82hk5c$80p$1@nnrp1.deja.com> <82hob6$avp$1@nnrp1.deja.com> Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 1999-12-07T00:00:00+00:00 List-Id: Robert Dewar wrote in message <82hob6$avp$1@nnrp1.deja.com>... >In article <82hk5c$80p$1@nnrp1.deja.com>, > reason67@my-deja.com wrote: >> Start_Time := Ada.Calendar.Clock; >> Free (Last); >> Stop_Time := Ada.Calendar.Clock; > >This is completely hopeless methodology, of course you will >not get useful results this way, the time for a Free is >orders of magnitude faster than the clock resolution. When I did some tests with GNAT 3.12p on Windows NT I used Ada.Real_Time.Clock to measure elapsed time. I do not know about GNAT 3.11 for Solaris but GNAT 3.12p Ada.Real_Time.Clock gives one nanosecond resolution on Windows NT (uses NT high performance counter). This information for particular platform could be found in GNAT reference manual. GNAT 3.11p for WinNT did not used NT high performance counter. In any case if OS has such counter it could be accessed via assembler routine. Here is a snippet from my code: with Ada.Real_Time; Procedure Test_Something; <...> use type Real_Time.Time; <...> begin <...> Start_Time := Ada.Real_Time.Clock; Do_Something (Number_Of_Iterations); -- contains loop which performs some action -- Number_Of_Iterations times Finish_Time := Ada.Real_Time.Clock; Elapsed_Time := Ada.Real_Time.To_Duration (Finish_Time - Start_Time); <...> end Test_Something; Regards, Vladimir_OLensky