comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: Apex vs GNAT on solaris
Date: 1999/12/09
Date: 1999-12-09T00:00:00+00:00	[thread overview]
Message-ID: <s4vt4untfkb156@corp.supernews.com> (raw)
In-Reply-To: 384F9FAE.8FEFEB30@acenet.com.au

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









  parent reply	other threads:[~1999-12-09  0:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-07  0:00 Apex vs GNAT on solaris reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` Robert Dewar
1999-12-07  0:00   ` Roger Racine
1999-12-07  0:00     ` Larry Kilgallen
1999-12-07  0:00     ` Samuel T. Harris
1999-12-07  0:00     ` David Starner
1999-12-08  0:00       ` Robert Dewar
1999-12-07  0:00     ` Jean-Pierre Rosen
1999-12-08  0:00     ` Robert Dewar
1999-12-08  0:00       ` Roger Racine
1999-12-08  0:00         ` Larry Kilgallen
1999-12-08  0:00           ` Roger Racine
1999-12-08  0:00             ` tmoran
1999-12-08  0:00             ` Larry Kilgallen
1999-12-09  0:00         ` Robert Dewar
1999-12-09  0:00           ` Roger Racine
1999-12-09  0:00             ` Mike Silva
1999-12-10  0:00               ` Robert Dewar
1999-12-09  0:00             ` Larry Kilgallen
1999-12-10  0:00               ` Robert Dewar
1999-12-16  0:00             ` Stefan Skoglund
1999-12-08  0:00       ` Robert A Duff
1999-12-08  0:00     ` Ted Dennison
1999-12-07  0:00   ` reason67
1999-12-08  0:00     ` Robert Dewar
1999-12-08  0:00       ` reason67
1999-12-08  0:00         ` Robert Dewar
1999-12-08  0:00         ` Larry Kilgallen
1999-12-08  0:00         ` Robert A Duff
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00   ` Robert Dewar
1999-12-07  0:00     ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00 ` reason67
1999-12-07  0:00   ` Robert Dewar
1999-12-07  0:00     ` reason67
1999-12-08  0:00       ` Robert Dewar
1999-12-08  0:00         ` reason67
1999-12-07  0:00     ` Vladimir Olensky
1999-12-07  0:00       ` Vladimir Olensky
1999-12-09  0:00       ` Geoff Bull
1999-12-09  0:00         ` Vladimir Olensky
1999-12-09  0:00         ` Vladimir Olensky [this message]
1999-12-10  0:00           ` Vladimir Olensky
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox