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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,134ffece5bb64502,start 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!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Michael Bode Newsgroups: comp.lang.ada Subject: Strange behaviour of delay in Windows Date: Thu, 07 Oct 2010 19:35:36 +0200 Organization: 1&1 Internet AG Message-ID: NNTP-Posting-Host: p5b24a0fc.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: online.de 1286472937 18758 91.36.160.252 (7 Oct 2010 17:35:37 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Thu, 7 Oct 2010 17:35:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-message-flag: IMPORTANT MESSAGE -- PLEASE READ IMMEDIATELY!!! X-Accepted-File-Formats: ASCII, .rtf, .ps, .pdf - *NO* MS Office files Xref: g2news1.google.com comp.lang.ada:14469 Date: 2010-10-07T19:35:36+02:00 List-Id: I would expect the delay statement to delay execution for the given time. So with this 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; I'd expect to get this result: Expected delay: 1.000000000 Actual delay: 1.000239000 But on one Windows machine (a Vostro MT 220, Windows XP) I get an actual delay of about 2.7s instead. I tried with GNAT GPL 2008 and 2009. There was no noticeable CPU load during the test. To make things more interesting, a different machine (Vostro MT 230, same RAM, same CPU, same Windows XP version) works as expected. And to make things even more interesting, the Vostro MT 220 normaly lives in the lab. When I found this bug I carried it over to my office to check things. In the office it worked ok. Back to the lab and I got the 2.7s, most of the time. A couple of times I got 1.0xxx seconds. Then I compiled the program statically linked on Debian, put a Ubuntu Live CD in the machine and tried my program. Result was dozens of times as printed above: 1.000xxx seconds. Any ideas?