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/10 Message-ID: #1/1 X-Deja-AN: 558769236 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-10T00:00:00+00:00 List-Id: Vladimir Olensky wrote in message ... >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. <..> >So all depends on hardware implementation. e.g: Pentium-III instruction RDTSC (Read Time-Stamp Counter): This instruction loads the current value of the processor's time-stamp counter into the EDX:EAX registers. <..> The processor increments the time-stamp counter MSR every clock cycle and resets it to 0 whenever the processor is reset. ------------------------------------ So on 700MHz PIII machine resolution could be up to 1.4 ns. Anyone can use this instruction directly to obtain the best possible time resolution and not to wait when Performance Counter will be updated in the next tick with the data from this TSC. Regards, Vladimir Olensky