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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,349427c451f66022 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" Newsgroups: comp.lang.ada Subject: Re: Strange behaviour of delay in Windows XP Date: Thu, 07 Oct 2010 23:35:53 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net hXMmAgbrUF932fEjyDIrFAYIqH+vXaGoakEofFeFd/9MubbaJs Cancel-Lock: sha1:QZTsGlrPXCCSYSlqK7k/VOMFCAw= User-Agent: Opera Mail/10.62 (Win32) Xref: g2news1.google.com comp.lang.ada:14424 Date: 2010-10-07T23:35:53+02:00 List-Id: On Thu, 07 Oct 2010 23:04:33 +0200, michael bode 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.