comp.lang.ada
 help / color / mirror / Atom feed
* Clock drift in gnat 3.13p on Windows
@ 2001-01-26 21:45 (null)
  2001-01-26 22:24 ` Pascal Obry
  0 siblings, 1 reply; 2+ messages in thread
From: (null) @ 2001-01-26 21:45 UTC (permalink / raw)



I have an Ada application compiled with gnat 3.13p.  It runs on NT
or Windows 2000 PC that gets periodic clock updates via NTP.  

When the program first starts up Ada.Calendar.Clock, Ada.Real_Time.Clock
and Win32.Winbase.GetLocalTime all agree on the time.  After the
program has run for a few hours and the PC has gotten a few NTP
time updates, GNAT's idea of the current time is off by a second
or two.

I'd like to periodically update the GNAT runtime system's idea of
the current time.  Would it be sufficient to periodically adjust
the value of Base_Clock and Base_Ticks in System.OS_Primitives?

-- 
=======================================================================
 Life is short.                  | Craig Spannring 
      Bike hard, ski fast.       | cts@internetcds.com
 --------------------------------+------------------------------------



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Clock drift in gnat 3.13p on Windows
  2001-01-26 21:45 Clock drift in gnat 3.13p on Windows (null)
@ 2001-01-26 22:24 ` Pascal Obry
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal Obry @ 2001-01-26 22:24 UTC (permalink / raw)



cts@kampong.aedinc.net ((null)) writes:

> I have an Ada application compiled with gnat 3.13p.  It runs on NT
> or Windows 2000 PC that gets periodic clock updates via NTP.  
> 
> When the program first starts up Ada.Calendar.Clock, Ada.Real_Time.Clock
> and Win32.Winbase.GetLocalTime all agree on the time.  After the
> program has run for a few hours and the PC has gotten a few NTP
> time updates, GNAT's idea of the current time is off by a second
> or two.

Well GNAT is using the High Performance Counter under NT to achieve high
resolution but this counter is certainly not updated by NTP updates...

> I'd like to periodically update the GNAT runtime system's idea of
> the current time.  Would it be sufficient to periodically adjust
> the value of Base_Clock and Base_Ticks in System.OS_Primitives?

Well, looking at the implementation it should work :) 
But you'll have to break the encapsulation of Base_Clock...

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-26 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-26 21:45 Clock drift in gnat 3.13p on Windows (null)
2001-01-26 22:24 ` Pascal Obry

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