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/09 Message-ID: #1/1 X-Deja-AN: 558660664 References: <82hiuj$74o$1@nnrp1.deja.com> <82hk5c$80p$1@nnrp1.deja.com> <82hob6$avp$1@nnrp1.deja.com> <384F9FAE.8FEFEB30@acenet.com.au> 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-09T00:00:00+00:00 List-Id: Geoff Bull wrote in message <384F9FAE.8FEFEB30@acenet.com.au>... > > >Vladimir Olensky wrote: >> >> GNAT 3.12p Ada.Real_Time.Clock gives one >> nanosecond resolution on Windows NT > >Now that's clever, on a system with a 3ns (or whatever) clock! >:-) Yes, you are right here about system clock. >From here a can make a guess that you are using 300 MHz machine. On 300MHz machine clock cycle is about 3 ns On 700MHz machine clock cycle is about 1.4 ns Finest possible resolution for GNAT is 1ns. (See GNAT ref.manual and implementation) In reality GNAT resolution depends on hardware high-resolution performance counter as Ada.Real_Time.Clock calls QueryPerformanceCounter from kernel32. ------------------------------------------ from System.OS_Primitives: ----------- -- Clock -- ----------- -- this is a high resolution clock implemented using -- QueryPerformanceCounter. This call return a 64 bits values (based on -- the 8253 16 bits counter). This counter is updated every 1/1_193_182 -- times per seconds. The call to QueryPerformanceCounter takes 6 -- microsecs to complete. function Clock return Duration is Current_Ticks : aliased LARGE_INTEGER; begin if not QueryPerformanceCounter (Current_Ticks'Access) then return 0.0; end if; return Base_Clock + Duration (Long_Long_Float (Current_Ticks - Base_Ticks) / Long_Long_Float (Tick_Frequency)); end Clock; ----------------- package Ada.Real_Time is type Time is private; Time_First : constant Time; Time_Last : constant Time; Time_Unit : constant := 10#1.0#E-9; ...... ---------------------------------------------------- So all depends on hardware implementation. Regards, Vladimir Olensky