comp.lang.ada
 help / color / mirror / Atom feed
* Strange behaviour of delay in Windows XP
@ 2010-10-07 21:04 michael bode
  2010-10-07 21:35 ` Vinzent Hoefler
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: michael bode @ 2010-10-07 21:04 UTC (permalink / raw)


Hi,

I've seen a very strange behaviour of the delay statement with GNAT on a
Windows XP machine. This is the code:

with  Ada.Text_Io; use Ada.Text_Io;
with Ada.Calendar; use Ada.Calendar;

procedure Testprog is
   T1, T2 : Time;
   D : Duration;
begin
   D := 1.0;
   T1 := Clock;
   delay D;
   T2 := Clock;
   Put_Line ("Expected delay:" & Duration'Image(D));
   Put_Line ("Actual delay:" & Duration'Image(T2-T1));
end Testprog;

And this is what it prints when run on Linux:

Expected delay: 1.000000000
Actual delay: 1.000321000

But I have a (or rather 2) Dell Vostro MT 220 PC where the actual delay
is about 2.7s instead. Tested with GNAT GPL 2008 and 2009 on XP. Another
almost identical Vostro MT 230 works as expected. And to make it more
interesting when I brought the Vostro 220 from my lab to my office it
worked as expected. Back to the lab I got the 2.7s delay again. Most of
the time. Sometimes I got 1.0xxs. There was no noticeable CPU load
during the tests. Then I booted the machine from a Ubuntu Live CD and
tested with the program compiled under Debian Lenny. It worked as
expected: 1.000xxx seconds delay.

Any ideas or should I call a feng shui master?



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

end of thread, other threads:[~2010-10-26  1:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-07 21:04 Strange behaviour of delay in Windows XP michael bode
2010-10-07 21:35 ` Vinzent Hoefler
2010-10-07 22:10   ` michael bode
2010-10-07 22:37 ` Jeffrey Carter
2010-10-08  5:18   ` michael bode
2010-10-08 10:13   ` michael bode
2010-10-08  0:15 ` Randy Brukardt
2010-10-08  5:33   ` michael bode
2010-10-09  6:42     ` Randy Brukardt
2010-10-09  8:18       ` Dmitry A. Kazakov
2010-10-26  1:50   ` Yannick Duchêne (Hibou57)
2010-10-08  7:54 ` Dmitry A. Kazakov

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