comp.lang.ada
 help / color / mirror / Atom feed
From: "Vinzent Hoefler" <nntp-2010-10@t-domaingrabbing.de>
Subject: Re: Strange behaviour of delay in Windows XP
Date: Thu, 07 Oct 2010 23:35:53 +0200
Date: 2010-10-07T23:35:53+02:00	[thread overview]
Message-ID: <op.vj7593km0k3wt7@jellix.jlfencey.com> (raw)
In-Reply-To: i8lcl2$f0i$1@news.eternal-september.org

On Thu, 07 Oct 2010 23:04:33 +0200, michael bode <m.g.bode@web.de> wrote:

[delay 1.0]
> 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.

Obviously your lab is very CPU intensive. ;)

> Most of the time. Sometimes I got 1.0xxs. There was no noticeable CPU
> load during the tests.

That's probably the explanation. Firstly, Windows is by no means an RTOS,
secondly GNAT's relative delay implementation uses the Sleep call, which
is quite crude when it comes to clock resolution (15 ms and more).
Add CPU load, disk activity and things and the delay can easily exceed
the "expected" time depending on when Windows decides to return from sleep.

With "delay until" you should get better results. Even adding a task could
help, because with tasking enabled, GNAT uses a different and more precise
implementation AFAIK.


Vinzent.

-- 
There is no signature.



  reply	other threads:[~2010-10-07 21:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 21:04 Strange behaviour of delay in Windows XP michael bode
2010-10-07 21:35 ` Vinzent Hoefler [this message]
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
replies disabled

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